This is getting really frustrating, but I guess that's what I get for trying something seemingly advanced without getting a complete grasp on the basics.
The thing is that a friend of mine asked me to build a site for her in trade for some massages for my Fiance's leg. He's already had two, and I still don't have a site for her.
Here goes:
I'm writing code for a new vBulletin page, and I'm having some trouble. I'd ask there, but this is a straight PHP question rather than a vBulletin question.
For the sake of clarity, all vB functions appear to be working properly, and I don't need help with them (I already got help with those on the vB.org forums).
What I need is to fine the primary numerical key in a multidimentional array that contains associative arrays.
Where I'm having problems is here:
if($vbulletin->userinfo['userid']){
$planners = $vbulletin->db->query_read("
SELECT *
FROM " . TABLE_PREFIX . "planners
WHERE memberid = " . $vbulletin->userinfo['userid'] . "
ORDER BY id DESC
");
$planners_array = array();
$planners_array[] = $vbulletin->db->fetch_array($planners);
if($vbulletin->GPC['planner']){
$plannerid = $vbulletin->GPC['planner'];
for($key = 0 ; isset($planners_array[$key]['id']) ; $key++){
if($plannerid = $planners_array[$key]['id']){
$planner = $key;
}
}
} else {
$planner = 0;
}
$menuids = $planners_array[$planner][menuids];
$menus = $vbulletin->db->query_read("
SELECT id, shortdescription, mealtype
FROM " . TABLE_PREFIX . "menus
WHERE id IN ($menuids)
");
}
When I type the planner ID that I need in the browser, it defaults to $planner=0
What might I be doing wrong here (I know, I'm oprobably WAY off. Noob, as I mentioned.).
Thanks!