DJMaze,
How come when i change the following code (In Bold)
from:
Code:
$records[] = $array;
to:
Code:
$records[1] = $array;
The the last record entered gets displayed as record 0 in stead of the second record being displayed?
Code:
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("WB", $con);
$result = mysql_query("select * from Birds");
header('Content-type: text/plain');
$records = array();
while ($array = mysql_fetch_assoc($result))
{
$records[0] = $array;
}
print_r($records);
?>