in my script php i need to format an array end encode it an a json format starting from a select like this:
$result = mysql_query("SELECT datet,vototags,votodom FROM intro_s1 WHERE intro_s1.www = '".$url."' ORDER BY intro_s1.datet DESC");
$data = array(
array('Date', 'v1', 'v2'),
);
while ($row = mysql_fetch_array($result)) {
$data[] .= array($row['datet'], $row['vototags'], $row['votodom']);
}
echo json_encode($data);
I need that $ date is as follows:
[[Date,vi,v2],[11/02/2011,12,32],[12/06/2012,99,109][...]
instead my result is:
[["Date","v1","v2"],"Array","Array","Array","Array",[...]
ehat is wrong in my code?
Thanks in advance
$data[] .=to$data[] =.