Been experimenting trying to get the ENCRYPT function to work in PHP code for sending data to a database. I want it to encrypt the password but i'm not quite sure of the syntax. So far i've got this but its obviously wrong?
('$_POST[username]','$_POST[productId]','ENCRYPT( '$password' )','$_POST[description]')";
It's not working because you're not concatenating the strings with .
.
'ENCRYPT( ' . $password . ' )'
Plus, who knows if you should be escaping those quotes with \
or not, since you didn't show the beginning of your string in your code.
Don't bother though... your code is incredibly insecure and wide open to SQL injection attacks. Use prepared/parameterized queries with PDO or similar, or you will be hacked without doubt. Also, don't use encryption on these passwords... uses hashes with salts, which are one-way functions.