[eluser]danmontgomery[/eluser]
I think you're making this more complicated than it needs to be... You only need one query:
Code:
$sql = "SELECT categoryTable.categoryTitle, categoryTable.categoryId, userMenuTable.cookieId, userMenuTable.menuEntryId, categoryTable.categoryOnline,
categoryTable.categoryIsSpecial, categoryTable.categoryDateCreated, categoryTable.categorySlug, categoryTable.dashboardUserId, categoryTable.categoryAbstract
FROM categoryTable
JOIN userMenuTable ON categoryTable.categoryId = userMenuTable.categoryId
WHERE userMenuTable.cookieId = 'some_string'";
Code:
if(isset($mainMenu)) {
foreach ($mainMenu as $k => $v) {
echo "<li class='menuItem'>
<a href='".base_url()."welcome/getContent/$v[categoryId]' class='" . ( strlen($v["menuEntryId"]) ? "saved " : "" ) . "navLink' id='$v[categoryTitle]'>".$v['categoryTitle']."</a>
</li>";
}
} else {
...
}
You're not very clear about what you're trying to accomplish (or maybe I'm just confused by the db structure)... If that's not what you're looking for, can you be more specific about the result you're trying to get?