RE: [PHP] MySQL problem - stumped

From: Date: Sat, 10 Mar 2001 19:34:49 +0000
Subject: RE: [PHP] MySQL problem - stumped
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43338@lists.php.net to get a copy of this message
Grr.. Thank You! God I feel like the idiot now. Why didn't I see that? Heck why didn't anyone else see it either :) I'm so used to using $rows = mysql_num_rows($result), that I just did the same thing here. But your right, the docs say THIS one takes a LINK and not a RESULT identifier. Grr.. Thanks again. Your a deadline saver :) - John Vanderbeck - Admin, GameDesign > -----Original Message----- > From: Christian Reiniger [mailto:creinig@mayn.de] > Sent: Saturday, March 10, 2001 2:32 PM > To: PHP User Group > Subject: Re: [PHP] MySQL problem - stumped > > > On Saturday 10 March 2001 19:58, you wrote: > > The following code is giving an me problems, I can't figure it out to > > save my soul. The last line gives: > > > > Here is the code: > > > > $link = db_connect(); > > $query = "UPDATE Users SET firstname='$firstname', > > lastname='$lastname' > > WHERE username='$user' && password='$password'"; > > $result = mysql_query($query, $link); > > $err = mysql_error(); > > echo "Errors:".$err; > > $rows = mysql_affected_rows($result); > > > > And here is the output: > > Errors: > > Warning: Supplied argument is not a valid MySQL-Link resource in > > /****/*****/****/**********.********.***/db.php on line 147 > > > > Line 147, is the last line in the above snippet. I cleared out the > > path name for security, no offense intended :) > > This one? > > $rows = mysql_affected_rows($result); > > Try > $rows = mysql_affected_rows($link); > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) > > The use of COBOL cripples the mind; its teaching should, therefore, > be regarded as a criminal offence. > > - Edsger W. Dijkstra > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#43338) next »