php - WHERE statement issues UPDATEing all rows -


I have a problem with my app where "Change your password" functionality reset all user's passwords to the same value Have given. I have restored a backup, so there is no big problem, except for this terrible firework, I have no fault.

Obviously this UPDATE statement did not have any value due to the condition of WHERE. It was through an active record query in CodeIgniter. There was a safeguard to avoid this issue:

  if (! Is_numeric ($ userdata ['client_id'])) ('User ID can not be retrieved from session');  

A typeof ($ userdata ['client_id']) tells me this is a "string", so my is_ numumeric probe should have worked fine . $ Userdata Array comes from session.

No users are with client_id 0, they all have one value.

I thought it was waiting for the "Change Password" page, after session after it was logged on after x minutes and then submitted the form. I tried it myself and it redirected me back to the login page, as it should be.

My WHERE statement attempts to match the value with $ userdata ['client_id'] with client_id_fk One or two test clients have Clul_ID_F tap - did such a testing client reset their password?

If not, then anyone stumped me?

My first guess would be that $ userdata ['client_id'] < Is the code> null and is_numeric () returning (incorrectly)?


Comments