I am trying to get mysql to put everything into a array which would be easier for me to work with later down the road.
I currently am using the following
$result = mysql_query('SELECT * FROM (SELECT * FROM new WHERE qc_status =\'pending\' AND call_date = \''.date("Y-m-d").'\' LIMIT 0,17) as assesmenttable ORDER BY RAND() LIMIT 1',$link);
$array = array();
while($row = mysql_fetch_array($result)){
foreach($row as $column => $value) {
$array[$column]= $value;
}
}
print_r($array);
}
but the issue is it is giving me an array like this
Array ( [0] => Ms [title] => Ms [1] => Belinda [fname] => Belinda
clearly it is doing something wrong i want the array to look like this
array([title]=>Ms, [fname]=>Belinda)
in JSON_encode it should look like this
{title:Ms,fname:Belinda}
if anyone can point me in the right direction that would be a great help