Tuesday 15 June 2010

PHP mysqli_num_rows change when changing the hash function -



PHP mysqli_num_rows change when changing the hash function -

so, trying alter hash function md5 sha256. works fine in sign phase, new user created new hash function applied password.

although, when seek log in, error. error have set in code, big problem here why happens @ all.

i have next code:

$sql = "select * username username='$u' , activated='1' limit 1"; $user_query = mysqli_query($db_conx, $sql); // create sure user exists in table $numrows = mysqli_num_rows($user_query); if($numrows < 1){ echo "that user not exist or not yet activated, press back"; exit(); }

i haven't changed here, when log in now, instead of arriving @ page supposed arrive at, arrive @ error message: "that user not exist or not yet activated, press back". have echoed out variable $numrows , shows $numrows equal zero. have no thought why has happened, because have changed hash function.

however, when press in browser, page supposed arrive @ in first place, , variable $numrows changed 1.

it nice if cared explain me, since have no thought why $numrows variable of sudden zero, rather >0.

regards

edit

i have, help of goleztrol, come either $numrows or $user_query false. now, question changed why happening.

edit2

after farther testing, can state not $user_query false, $numrows.

php function hash mysqli sha256

No comments:

Post a Comment