Page 1 of 1

Crypt field

Posted: 2019-06-19 20:07
by A Bindi
I would want to populate a table's field with a crypted copy of another field:

table name: an_utenti_servizi
source field: password'
destination field (crypted): password_crypt

Below the hook's after_update function that does not doesn't work :(

named "password_crypt "

Code: Select all

function an_utenti_servizi_after_update($data, $memberInfo, &$args){

		$sql_string = "update an_utenti_servizi set password_crypt = AES_ENCRYPT({$data['password']},'MySecretKey') where id = {$data['id']}"; 
		$result = sql($sql_string, $eo);
		
		return TRUE;
	}
Can anyone help ?

ALex.