looping lists
Posted: Fri Feb 06, 2004 5:11 am
Trying to get it to cycle through the list and assign the results to a variable but it only picks up the last one. Any ideas?
-------------------------------------------------------------------------------------
$result = mysql_query ("SELECT* FROM postcodes");
while (list(,$areacode)= mysql_fetch_array($result)){
$areaone = sprintf (" %s", $result);
}
print $areaone;
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
$result = mysql_query ("SELECT* FROM postcodes");
while (list(,$areacode)= mysql_fetch_array($result)){
$areaone = sprintf (" %s", $result);
}
print $areaone;
-------------------------------------------------------------------------------------