Re: Question on Registration Method

From: Date: Sun, 26 Sep 2004 16:14:21 +0000
Subject: Re: Question on Registration Method
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-36403@lists.php.net to get a copy of this message
I'm getting an error using the "mysql_num_rows($result)" Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/lurkkcom/public_html/lurktivate.php on line 7 Why am I counting the number of rows in the table? Shouldn't I be looking to see if the code I was passed exists within the table ? Sorry and thank you, Stuart --- Joseph Crawford <codebowl@gmail.com> wrote: > no you dont need a user id or anything, here is some > sample code to > give you the idea > > $result = mysql_query("SELECT fields FROM table > WHERE code=".$_GET['code']); > if(mysql_num_rows($result) > 0) { > // we have a match, activate the account > $result1 = mysql_query("UPDATE table SET > activated=1 WHERE > code=".$_GET['code']); > // show a page saying they are now activated > } else { > // show an error > } > >

« previous php.db (#36403) next »