Pulling a result from database
Posted: Mon Apr 21, 2008 7:18 am
Hi all,
I'm fairly new to PHP. I'm not sure what is going wrong.
I have a very simple sql that is returning a result on the database. but when I use a php to pull the data. its not showing any result.
THis is the code:
The output I get for this code is: : Array : strange I dont know why.
So I tried the another methord:
Nothing gets displayed for the above code.
when I try this sql
on mysql db I get the output as I know there is a record.
what is the wrong... can some one spot the mistake...
thanks
I'm fairly new to PHP. I'm not sure what is going wrong.
I have a very simple sql that is returning a result on the database. but when I use a php to pull the data. its not showing any result.
THis is the code:
Code: Select all
$result = mysql_query("Select subscriberid from SendStudio_list_subscribers where formid=5 order by subscriberid desc");
if ($row = mysql_fetch_row($result)) {
print "$CartID: ".$row." ";
} else {
print (mysql_error());
}
print "$CartID: ".$CartID." ";
exit();
So I tried the another methord:
Code: Select all
$result = mysql_query("Select subscriberid from SendStudio_list_subscribers where formid=5 order by subscriberid desc");
while($r=mysql_fetch_row($result))
{
$CartID = $r["subscriberid"];
echo "$CartID: ".$CartID." ";
}
print "$CartID: ".$CartID." ";
exit();
when I try this sql
Code: Select all
Select subscriberid from SendStudio_list_subscribers where formid=5 order by subscriberid desc
what is the wrong... can some one spot the mistake...
thanks