Q:

inserting mutltiple form data via php into multiple mysql tables

Still very new to php but learning quickly. I have two forms that gather data that is then passed to a php function. All the data from both forms is making it to the php file as I am echoing the values to be sure.
My issue is the first table is updated correctly without any issues but the second table is not updated.
Here is the code in question
private function registerNewUser($user_name, $user_email, $user_password, $user_password_repeat, $captcha, $user_type, $first_name)
....

// write new users data into database
    $query_new_user_insert = $this->db_connection->prepare('INSERT INTO users (user_name, user_password_hash, user_email, user_activation_hash, user_registration_ip, user_registration_datetime, user_type) VALUES(:user_name, :user_password_hash, :user_email, :user_activation_hash, :user_registration_ip, now(), :user_type)');                
    $query_new_user_insert->bindValue(':user_name', $user_name, PDO::PARAM_STR);
    $query_new_user_insert->bindValue(':user_password_hash', $user_password_hash, PDO::PARAM_STR);
    $query_new_user_insert->bindValue(':user_email', $user_email, PDO::PARAM_STR);
    $query_new_user_insert->bindValue(':user_activation_hash', $user_activation_hash, PDO::PARAM_STR);
    $query_new_user_insert->bindValue(':user_registration_ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);
    $query_new_user_insert->bindValue(':user_type', $user_type, PDO::PARAM_STR);                
    $query_new_user_insert->execute();              

// id of new user
    $id = $this->db_connection->lastInsertId();

    echo $first_name;
    echo $user_email;
    echo $id;
//  attempt at writing to additional table
    $this->db_connection->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
    $query_new_user_insert2 = $this->db_connection->prepare('INSERT INTO C_Customer (First_Name, Email_Address, Created_Date, id) VALUES(:first_name, :user_email, now() :id');
    $query_new_user_insert2->bindValue(':first_name', $first_name, PDO::PARAM_STR);
    $query_new_user_insert2->bindValue(':user_email', $user_email, PDO::PARAM_STR); 
    $query_new_user_insert2->bindValue(':id', $id, PDO::PARAM_INT);
    $query_new_user_insert2->execute(); 

$query_new_user_insert works as the table is updated
$query_new_user_insert2 does not work as the table C_Customers contains no data.

A:

On second query, you forgot to put comma between now() and :id. Also, you forgot to put closing bracket.
prepare('INSERT INTO C_Customer (First_Name, Email_Address, Created_Date, id) VALUES(:first_name, :user_email, now() :id')

should be
prepare('INSERT INTO C_Customer (First_Name, Email_Address, Created_Date, id) VALUES(:first_name, :user_email, now(), :id)');

Another typo :) hope it helps.

