View Single Post
Old 04-09-2009, 09:04 AM   #3 (permalink)
kmote
 

Join Date: Jul 2005

Location: England

Posts: 2,167

kmote has a spectacular aura aboutkmote has a spectacular aura about

Default Re: PHP not sure how to compare 2 fields.

Your comparison looks fine to me. You might want to try echoing $password and $confirm_password to check that they are in fact the inputs you have given.
Couple of notes about the other parts of the code though; 1) you don't need to encrypt your $confirm_password. 2) The way you are getting your ID is dangerous. If a row is deleted from the table the row count will go down but your next ID never should (since it is not necessarily the last record that was deleted). Instead, use an autoincrementing value on the database and remove the ID from your insert statement.

EDIT: almost forgot, you should also check that the insert is successful
__________________
MSI P43 Neo|Enermax Pro82+ 425W|E5200|silent 8500GT|250GB Samsung spinpoint F1|Samsung SATA DVD RW|4GB Corsair|Antec SOLO|openSUSE11


There are in order of increasing severity: lies, darn lies, statistics, and computer benchmarks. - diskinfo man page

Last edited by kmote; 04-09-2009 at 09:08 AM.
kmote is offline