Hi,
How do I populate a flat array through a loop type sequence.
So far I have a basic query resulting in a few rows of data.
$sSql = 'SELECT suburb'
. ' FROM locations'
. ' WHERE locations.postcode = '.$postcode
. ' LIMIT 0 , 40;';
$result = mysql_query($sSql) or die('Query failed: ' . mysql_error());
$numberOfRows = mysql_num_rows($result);
$i = 0;
$SuburbArray = array(); // define the array
if ($numberOfRows>0) {
while ($i<$numberOfRows) {
echo mysql_result($result,$i,"suburb");
$thisSuburb = mysql_result($result,$i,"suburb");
// I need to add each value to array here.
$i++;
}
}
thank you.