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 <[EMAIL PROTECTED]> 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
> }
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to