I'm really trying to wrap my brain around how this works...no such luck...I'll just break it out the way I started and see if somebody can help me see this one through...
What I'm doing here is querying two tables to retrieve three results - this works just fine. Then, as I loop through the results I make another query at each pass to retrieve img and content which are stored in the same table as the previous query.
Is there a way to combine all of this into one query? I've been messing with a SELECT within a SELECT and also UNION without any luck...
Thanks if somebody can help me see this one...I'm obviously not there yet on my own.
$rs = $db->fetchArray("SELECT obj_ref_id,title,obj_capt,url
FROM mww_objects,mww_objects_prefs
WHERE object = 'gallery'
AND obj_ref_id = obj_id
AND type = '1'
AND status = '1'
ORDER BY obj_udate DESC LIMIT 3");
// this is called from a separate function as
// getPhoto($rs['obj_ref_id'])
$rs = $db->fetchRecord("SELECT img,content
FROM mww_objects
WHERE object = 'gallery'
AND type = '2'
AND obj_ref_id = '$id'
ORDER BY udate DESC");