let's say I have this query
SELECT data.*, art.*
FROM `comic_pages` data, `artwork_picture` art
WHERE data.art_id = art.uid
however both comic_pages and artwork_picture contains an 'uid' field, and I need both uids. I've made up this function, but I think it's kinda hacky (and slow, taking over 6x the speed of a normal mysqli_fetch_assoc in this case)
function db_multi_fetch_assoc ($result){
if (!is_object ($result))return false;
for ($x = 0;@mysqli_field_seek($result,$x);$x++){
$field = mysqli_fetch_field ($result);
$arr[$x] = $field->table.'.'.$field->name;
}
$data = mysqli_fetch_row ($result);
for ($y=0;$y<$x;$y++)$out[$arr[$y]] = $data[$y];
return $out;
}
if anyone can suggest me a better way I appreciate it