$icn = $DB->fetch("SELECT icon FROM $tab[fam] WHERE id='$id'", __FILE__, __LINE__); $icn2 = $DB->fetch("SELECT icon FROM $tab[fam] WHERE id='$pid'", __FILE__, __LINE__); Would it be possible to make that into one array instead of two queries? Like $icn['first'] and $icn['second'], would be the same query but 'first' => WHERE id='$id' and second => WHERE id='$pid' Just trying to make my code more compact...
Try: $icn = $DB->fetch("SELECT icon FROM $tab[fam] WHERE id='$id' OR id='$pid'", __FILE__, __LINE__); print_r($icn);
do a var_dump($icn) and that will tell you what is what. it may say [0]->"blah" [1]->"blah1" Then $icn[0]=blah and $icn[1]=blah1 it is harder to explain then I thought.
The first item in the array is the id and so on. MySQL returns columns the same order you specified them in the query.