can't insert data to table

I am having a problem inserting data into a table. I’m carrying it over from a temp table and placing it in a permanent one. I think I am getting the data out of the temp table just fine, but can’t seem to get it placed into the second table.

Later on in the script when I check if($result2) I always get to the else because it didn’t process. I am sure the variables are not just blank because when they are sent in an email I receive the values just fine.

Any help at all would be excellent. Thanks.

[code]// set date variables

$date=date(“l F d, Y, h:i:s”);

// passkey from email link


// access temporary table

// Retrieve data from table where row that match this passkey

$sql1=“SELECT * FROM $tbl_name1 WHERE confirm_code=’$confirm_code’”;

// If successfully queried


// Count the row number of the passkey


// if the confirm_code is found in the database, retrieve data from table “temp_member”



// access permanant table


// Insert data that retrieves from “temp_member” into table “register_member”

$sql2=“INSERT INTO $tbl_name2(‘confirm_code’, ‘date’, ‘email’, ‘output0’, ‘output1’, ‘output2’, ‘output3’, ‘output4’, ‘output5’, ‘output6’, ‘output7’, ‘output8’, ‘output9’, ‘output10’, ‘output11’, ‘output12’, ‘output13’, ‘output14’, ‘output15’, ‘output16’, ‘output17’, ‘output18’, ‘output19’, ‘output20’, ‘output21’, ‘output22’, ‘output23’, ‘output24’, ‘output25’, ‘output26’, ‘output27’) VALUES (’$confirm_code’, ‘$datedb’, ‘$email’, ‘$output0’, ‘$output1’, ‘$output2’, ‘$output3’, ‘$output4’, ‘$output5’, ‘$output6’, ‘$output7’, ‘$output8’, ‘$output9’, ‘$output10’, ‘$output11’, ‘$output12’, ‘$output13’, ‘$output14’, ‘$output15’, ‘$output16’, ‘$output17’, ‘$output18’, ‘$output19’, ‘$output20’, ‘$output21’, ‘$output22’, ‘$output23’, ‘$output24’, ‘$output25’, ‘$output26’, ‘$output27’)”;

I needed to remove the single quotes from the row names so that they would not be accessed as strings.

Sponsor our Newsletter | Privacy Policy | Terms of Service