Wallpapers Forums Login

Warning: Mysql_fetch_row(): Supplied Argument Is Not A Valid MySQL Result Resource In

ok, so how do you fix this error?

i have a script that i created and i can't get passed this.

i was told by a friend that you guys and webune have excellent support, how can you help me?
bret Mon Jun 18, 2007
thanks, that worked for me.

thanks webune, i really appreciated.

im new at this, but it really helps to have guys like this, that's why i have two of my websites hosting at webune.com

thanks for your help.
webune Mon Jun 18, 2007
ok, i found your problem, you need to enclose the value

replace this:
$sql = "select count(*) as total from ".$db_prefix."table where id = $id";

with this:
$sql = "select count(*) as total from ".$db_prefix."table where id = '$id'";

all i basically added was single quotes on you $id to make it look like this: '$id'

try it and let me know if it helps
bret Mon Jun 18, 2007
sure, this is what i see now:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/www/index.php on line 158

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
webune Mon Jun 18, 2007
replace
$row = mysql_fetch_row($result);

with this
if(! $row = mysql_fetch_row($result)){echo mysql_error();}

this will show you what the error you are getting from the mysql server

post the error here ok
bret Mon Jun 18, 2007
sure, it looks like this:

$sql = "select count(*) as total from ".$db_prefix."table where id = $id";
$result = mysql_query($sql ,$db);
$row = mysql_fetch_row($result);
webune Mon Jun 18, 2007
can you provide your sql query please?

Related Content

Information

Share

wallpaperama | Wallpapers | Forums | Terms Of Service

copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5