Insert from database into multidimensional array
Posted: Wed Dec 23, 2009 5:45 am
I am not be able to insert data from mysql database into this array:
What am I doing wrong?
Code: Select all
$sql = "SELECT name, surname, age, birthday, country FROM persons";
$query = mysql_query($sql) or die(mysql_error());Code: Select all
while($row = mysql_fetch_assoc($query)) {
$arrayTest = array(
array (
"name" => $row['name'],
"surname" => $row['surname'],
"age" => $row['age'],
"birthday" => $row['birthday'],
"country" => $row['country'],
)
);
}