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