本文介绍了帮助显示所有记录而不是1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨ppl我需要帮助我的php基本上我设法让我的php显示匹配sql条件的uname但是它只返回1条记录当有2条记录匹配条件我如何让它显示所有记录匹配条件而不是只显示一个?

这是我的代码:

[PHP]

$ resultpostal = mysql_query(" SELECT location.uname,location.uid FROM location,district WHERE districts.districtno ='''56''AND

location.lat BETWEEN districts.startlat AND districts.endlat AND location.lng BETWEEN districts.startlng AND districts.endlng");


$ counterx = 0;

if($ row = mysql_fetch_array($ resultpostal)){

foreach($ row as $ col_value){

$ temp [$ counterx] = $ col_value;

$ counterx ++;

}





$ report。=" uid"。" ="。$ temp [0]。"& ;" ;;

$ report。=" uname"。" ; ="。$ temp [1]。"&";




echo $ report;



[/ PHP]

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 how do I make it display all record that matches the condition instead of displaying just one?
This is my code:
[PHP]
$resultpostal=mysql_query("SELECT location.uname,location.uid FROM location,districts WHERE districts.districtno =''56'' AND
location.lat BETWEEN districts.startlat AND districts.endlat AND location.lng BETWEEN districts.startlng AND districts.endlng");

$counterx=0;
if($row=mysql_fetch_array($resultpostal)){
foreach($row as $col_value){
$temp[$counterx]=$col_value;
$counterx++;
}





$report.="uid"."=".$temp[0]."&";
$report.="uname"."=".$temp[1]."&";




echo $report;


[/PHP]

推荐答案




这篇关于帮助显示所有记录而不是1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 16:44