I have a problem with the following code. index.php crud.class.php The code “works” but it doesnt do it the right way. It does update at the requested id in the correct table, but the values are both the same. The data base contains 2 cols (gerecht and omschrijving) and the values that will be updated to the database a both
Tag: sql-update
lastInsertId() for UPDATE in Prepared Statement
The code above does not work. The value I am trying to get is primary key auto increment. As lastInsertId() suggests by its name, it may be intended for insert only. If so, what is the proper way to achieve the same goal on an UPDATE? The value I wish to return is the primary key of the table, if
How to check if PHP field is empty when using SHA1
I’m using SHA1 to encrypt a password. In my original code I checked if the password fields were empty with: if (empty($newpassword) and (empty($newpassword2))) { } Since I now use SHA1 and it automatically generates da39a3ee5e6b4b0d3255bfef95601890afd80709 when field is left blank, how do I re-write my code? Translate da39a3ee5e6b4b0d3255bfef95601890afd80709 back to string? Or something else? Please help. Answer What you