$result
is false
because your query is invalid (has a syntax error). Use:
$sql = "UPDATE members SET conf=2 WHERE email = '$email_to';"
(note the quotes surrounding $email_to
)
Also mysql_num_rows()
should be used for SELECT
queries only. For UPDATE
, INSERT
and DELETE
, use mysql_affected_rows() instead.
Finally, for future reference, if your query doesn't work, print the error and the SQL query used (something like what's on Col Shrapnel's answer). It will help you know what's wrong.