[Please reply to: [EMAIL PROTECTED], thanks...]

Hi Wrox guys and all,

Can anyone help me out on this??

I've been using this code for quite some time now. I got it from the
"Beginning PHP4 by Choi, Kent, Lea, Prasad, and Ullman". All those times, I
don't get any errors UNTIL tonight! :(

I am now getting this error message:
"Warning: Supplied argument is not a valid MySQL result resource in
c:\nusphere\apache\htdocs\domainfolder\register.php on line 17"

Below is the code (FOUND ON BEGINNING PHP4 - PAGE 469):

function in_use($username){
 global $user_tablename;

 $query = "SELECT username FROM $dbuser WHERE username = '$username'";
 $result = mysql_query($query);
 if(!mysql_num_rows($result)) return 0; // this is the line 17.
 else return 1;
}

note: I actually just substituted the $userid variable with $username.

What it does is to compare the username to that found on the userprofile
table and if it did not find any, it will return false (0) but if there's an
existing entry of the queried username, the function will return true. It
will then be compared using a condition statement where the registrant will
be prompted to change the username if the username is already in use. The
whole register.php page it was used is from PAGE 468 to 472. Am I missing
something here?

Does this have anything to do with updated MySQL parser? I am now using
MySQL version 3.23.36.

Can anyone help me get around this one. I really need help on this due to
time constraints. :)

Please help!!!

thanks a lot.

Sam
Netfuze Hypermedia Designs



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to