...

View Full Version : mysql_result error?



Bobafart
03-03-2008, 02:34 AM
Well I am going on my 17th hour of straight coding today... and i cant seem to see why i am getting this error:



$getCreatorUsername="SELECT username FROM ausers WHERE userID=$creatorUserid";

echo '<p>'.$getCreatorUsername; // returns the proper field nicely

$resultCreatorUsername = mysql_query($sqlCreatorUsername);

$creatorUsername=mysql_result($resultCreatorUsername,0,0); // this is the error line


Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/path/www/groups/join.php on line 119

looks good to me!

Bobafart
03-03-2008, 02:38 AM
the line: echo '<p>'.$getCreatorUsername;

outputs:

SELECT username FROM ausers WHERE userID=1

and the result is one VARCHAR field: 'dude'

_Aerospace_Eng_
03-03-2008, 03:06 AM
You don't have any error checking so your query could be failing.

$resultCreatorUsername = mysql_query($sqlCreatorUsername) or die(mysql_error());

abduraooft
03-03-2008, 02:33 PM
Well I am going on my 17th hour of straight coding today... and i cant seem to see why i am getting this error:

$getCreatorUsername="SELECT username FROM ausers WHERE userID=$creatorUserid";

echo '<p>'.$getCreatorUsername; // returns the proper field nicely

$resultCreatorUsername = mysql_query($sqlCreatorUsername);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum