ggalan
02-11-2012, 12:00 AM
ive always had issues with arrays. can anyone help out how to push 2 values into an array so that i can echo them later please?
$arr = array();
$query0 = "SELECT navid, type FROM mytable WHERE id='$id' ORDER BY navDisplayNum ASC";
$result0 = mysql_query($query0) or die (mysql_error());
while ($dataList = mysql_fetch_assoc($result0)) {
$navid = $dataList['navid'];
$type = $dataList['type'];
$arr[] = array($type,$navid);// this doesnt work
}
echo $arr;
$arr = array();
$query0 = "SELECT navid, type FROM mytable WHERE id='$id' ORDER BY navDisplayNum ASC";
$result0 = mysql_query($query0) or die (mysql_error());
while ($dataList = mysql_fetch_assoc($result0)) {
$navid = $dataList['navid'];
$type = $dataList['type'];
$arr[] = array($type,$navid);// this doesnt work
}
echo $arr;