on 8/25/01 12:11 PM, sam at [EMAIL PROTECTED] wrote:

> 
> 
> 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"
> 
> 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;
> }

Is that the code for the function exactly?  If so, where is $dbuser set?  If
it's set outside the function, you need to make it a global

global $user_tablename,$dbuser;

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

Possibly if the version of PHP that you are using was linked to old versions
of the MySQL headers.  You may need to recompile PHP.

Sincerely,

Paul Burney

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Paul Burney
Webmaster && Open Source Developer
UCLA -> GSE&IS -> ETU
(310) 825-8365
<[EMAIL PROTECTED]>
<http://www.gseis.ucla.edu/>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



-- 
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