![]() |
| |||||||
| PHP Forum PHP Forum. PHP Programming questions and answers here. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
| |||
| newbie: accessing columns in a select
php version 5 Here is some code from index.php: $sql = "select A.text, A.link, B.text, B.link, C.text, C.link from menu A, menu B left outer join menu C on B.MenuItemID = C.parent where B.parent = A.MenuItemID and A.MenuItemID = $MenuItem"; $result = $dbh->query($sql); while ($menuitem = $result->fetch_assoc()) { echo "<a href={$menuitem['Link']}>{$menuitem['text']}</a>"; echo "<br>"; } As you can see from my select, I've joined the menu table with itself 3 times...My problem is in this line: echo "<a href={$menuitem['A.Link']}>{$menuitem['A.text']}</a>"; I cannot access the columns in the resulset using A.Link, A.text, B.Link etc... But I want to access them, how do I access the columns here? Please, help me with this problem! Jeff |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I need ajax script, when i select country from select box than its cities should... | zahidsardar99 | AJAX Forum | 0 | 08-30-2008 12:38 AM |
| In MYSQL, Can I have the sum of two columns in 1 query? | pot | Mysql Forum | 0 | 06-05-2008 01:51 PM |
| In MySQL, does having too many columns make a difference when those columns are not | Anonymous | Mysql Forum | 0 | 01-11-2008 02:34 AM |
| Reordering Columns | Bruno | Mysql Forum | 0 | 05-22-2005 01:49 PM |
| Newbie q: Make user select "yes" to advance to specified URL | tHatDudeUK | PHP Forum | 1 | 11-15-2004 09:07 AM |