how to get all data in single array
without using while statement.
here is some code but its not working good..
any idea about whole query result in sigle assoc array.. any idea??
$data=array();
$sql = "SELECT `Name`, `Title`, `Version`, `Date`, `Cover`, `Content` FROM dict";
$result=mysql_query($sql);
while($data[]=mysql_fetch_assoc($result))
{
$data[]=mysql_fetch_assoc($result);
}
print_r($data);
You can wrap it into a function of it’s own (and correct the error) so you can’t mis-type it any longer:
Usage:
Take care that
$resultmust be a valid result.