[EMAIL PROTECTED] wrote:
looks a bit strange to me.

$result = mysql_query($query) or die('Query couldn\'t
executed:'.mysql_error());

please try something like this:

Why?  There's nothing wrong with the above statement.

// build the query - (that's OK)
$query = "UPDATE members SET email_verified='X' WHERE
logon_id='" .$logonid. "'";
// send the query to the server - save the result resource
$res = mysql_query($query);

// test for the result of the above query
if(!$res)
  {
  // stop the script if the result is not valid
  die('Query couldn\'t be executed:'.mysql_error());
  }

Fine so far, but the code below repeats the problem. There are no rows to process, because there was no SELECT.

// process a valid result
$row = mysql_fetch_array($res)

if (mysql_num_rows($res) == 1)
  {
  // the user id and password match,
  print("User id on db");
  }
else
  {
  //$errorMessage = 'Sorry, wrong user id / password';
  print("Sorry, wrong user id / password");
  }

I've not tested this - but it looks like you are mixing sending the
mysql query and testing for the result of the query at the same time,
which AFAIK is not possible.

You should try it. It works just fine, and isn't the problem. The problem is that you cannot treat the result of an UPDATE as if it were a SELECT.

<snip>

Using this code I get this error message.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in /usr/local/www/data/mls_verifyemail.php on line

Probably because you are not sending a valid query to the server,
you will not be getting a valid result resource back from the server.

The query was valid, and it worked, but mysql_num_rows() is only for SELECTs.

Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to