Page 1 of 1

$result didn't work as it should

Posted: Thu Sep 09, 2004 8:44 pm
by victor
I updated my verify my password using the following

?>
$query = "update user set Password = password('$new_password') where username = '$username'";

$result = @mysql_query($query);

Code: Select all

<?php

when injecting a invalid username, the $results still prints '1' (It should print '0' ), however mysql_affected_rows function returns '0' rows. can someone advise why is this the case.

Posted: Fri Sep 10, 2004 12:21 am
by feyd
that's the correct response. the query did not fail, it updated zero rows.