PDA

View Full Version : Php return undefine value to actionscript



rocky86
August 6th, 2007, 05:37 AM
Hi I having problem here how come the uid is undefined value on the actionscripts? the uname is able to be display but the uid is undefinded but I don't know why it return undefinded value? uid is the id of the username like eg: 1,2,3


PHP Code:

$resultpostal=mysql_query("SELECT location.uname,location.uid FROM location,districts WHERE districts.districtno ='$postalno' 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]."&"; echo $report;



Anybody know?

joran420
August 6th, 2007, 12:21 PM
$report = "&";
while($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;

eirche
August 6th, 2007, 01:00 PM
i am containing my frustration. you are not spending any effort trying to debug this by yourself.

you have two options, i can give you a working code, or i can help you to go through the debugging process.

i can give you fish or i can teach you how to fish.

rocky86
August 6th, 2007, 07:19 PM
i am containing my frustration. you are not spending any effort trying to debug this by yourself.

you have two options, i can give you a working code, or i can help you to go through the debugging process.

i can give you fish or i can teach you how to fish.

I noe I being asking too much cause I left with just 5 day to finish up my assignment so I don't have much time left I did try alot of debuging from while to if it just return me undefinded value I also try to just check for 1 record instead for all and the result I get is uid=Khali Signh&uname=Khali Signh& it just give me the same result over and over again
can you show me the code I figure out the rest myself

eirche
August 6th, 2007, 08:54 PM
$data = array();
while($row=mysql_fetch_assoc($resultpostal))
{
$data[] = $row;
}
echo http_build_query($data); // need php5