rocky86
08-06-2007, 05:49 AM
Hi ppl I need help with my php basically I manage to get my php to display the uname that matches the sql condition however it only return 1 record when there are 2 record that match the condition I understand that my code can only return the first row instead of the second or third row that matches the condition my question is how to modify my code to make it able to display not only the first but all of the row that fulfill the sql condition?
$resultpostal=mysql_query("SELECT location.uname,location.uid FROM location,districts WHERE districts.districtno ='57' AND
location.lat BETWEEN districts.startlat AND districts.endlat AND location.lng BETWEEN districts.startlng AND districts.endlng");
$counterx=0;
while($row=mysql_fetch_array($resultpostal)){
foreach($row as $col_value){
$temp[$counterx]=$col_value;
$counterx++;
}
$report.="uid"."=".$temp[0]."&";
$report.="uname"."=".$temp[1]."&";
$resultpostal=mysql_query("SELECT location.uname,location.uid FROM location,districts WHERE districts.districtno ='57' AND
location.lat BETWEEN districts.startlat AND districts.endlat AND location.lng BETWEEN districts.startlng AND districts.endlng");
$counterx=0;
while($row=mysql_fetch_array($resultpostal)){
foreach($row as $col_value){
$temp[$counterx]=$col_value;
$counterx++;
}
$report.="uid"."=".$temp[0]."&";
$report.="uname"."=".$temp[1]."&";