Hello,
I have an existing query with an insert statement to table A. I'd like to append an additional insert statement to table B. I've tried numerous methods, but can't get it to work. Below (snippet #1) is the existing query, followed by (snippet #2) the addition I'd like to make. Thanks in advance....
/SNIPPET 1 Existing/
function add_new_user_account($sess,$email,$password,$name,$company,$address,$city,$state,$zip,$country,$phone,$fax,$username) {
global $require_email_ver, $aid;
if ($aid == "") {
$aid = get_aid($sess);
}
$today = date("Y-m-d");
$db = new ps_DB;
$q = "INSERT INTO account SET
orig_date = '$today',
account_affiliate_id='$aid',
account_email ='$email',
account_password ='$password',
account_name ='$name',
account_company ='$company',
account_address ='$address',
account_city ='$city',
account_state ='$state',
account_zip ='$zip',
account_country ='$country',
account_phone ='$phone',
account_username ='$username',
account_fax ='$fax'";
if ($require_email_ver == "Y") {
$q .= ", account_status = '1'";
}
$db->query($q);
/the above works fine/
/SNIPPET 2, example of what I want to add./
INSERT INTO 'content1' ('id', 'userid', 'content1_1') VALUES ('', 'example', 'Add content test');
I tried to just paste SNIPPET #2 after the if statement and before $db, but it throws a syntax error. I also tried to do another $q .= to append the next insert statement, but I get a syntax error. What am I doing wrong? Maybe I misunderstand how this should work?
Thanks in advance...
atsphpflash