Thursday, 19 September 2013

How do save a value in a multi-dimensional array

How do save a value in a multi-dimensional array

I need to salve the result of the variable $res into a mufti-dimensional
array to then save in the json_encode.
<?php
include("config.inc");
$query = "SELECT * FROM accounts ";
$res = mysql_query($query);
$arr = array(array($res));
echo json_encode($arr);
mysql_close($con);
?>
What am I doing wrong? How do I save the "$res" into a array? Thx

No comments:

Post a Comment