|
Posted by Jeff on 11/24/05 02:18
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
Navigation:
[Reply to this message]
|