Well, for a starter, you are mixing INSERT and UPDATE syntax:
insert:
Code:
INSERT INTO tblName
(filed1, field2,field3)
VALUES
(value1, value2, value3)
update:
Code:
UPDATE tblName
SET field1=value1, field2=value2, field3=value3
WHERE primaryKeyField=xxx
Secondly, you have an PHP syntax error, on the $query2 line.
PHP Code:
$query2 = "Update ".MYSQL_TBL_CLIENTS." Set ssn=aes_encrypt(ssn,'$aes_key') where (????);
should be:
PHP Code:
$query2 = "Update ".MYSQL_TBL_CLIENTS." Set ssn=".aes_encrypt(ssn,$aes_key)." where (????);";
// !! Check the "ssn" parameter in the aes_encrypt function up there.
// If it's not a constant, it will trigger an error.
Now, what should your $query_string contain?
Is it the values of your form?
Then, you should compose your script differently. Hit the $_GET ot $_POST arrays directly.
You will found all the variables of your form there.
For exemple, if you have an input field named "ssn" in your form and are sumitting with a POST method:
PHP Code:
$ssn=$_POST['ssn'];
Simply repeat this for all your forms fields (or use a foreach, or extract), and compose your query that way.
foreach example:
PHP Code:
/**
* Does the same as extract(), but you could use the loop to do other
* actions. All the indexes in the $_POST array are traversed with this.
* !!! the $$name is not a typo. It means "create a variable with the name as the content of $name".
* So, if $name="heyYou", then it will create a variable $heyYou
*/
foreach($_POST as $name=>$value){
$$name=$value;
}