I have a MySQL table like this:
------------
|animal|legs|
------------
| cat 4 |
| chicken 2 |
Is it possible to return an array in PHP with animals as its index name and legs as its values without fetching one by one as in mysqli_fetch_all ?
$result[cat]=4
$result[chicken]=2.
I tried
$q = mysqli_fetch_all($q);
$array=array_combine($q2[0], $q2[1]);
but it does not give me the output that I wanted.