It has been a long day, been at it since 6am pst (10hrs!)
Got everything kind of working then realized I was using the
$userid = mysql_insert_id(); which works for those cases where it was a new user that was just inserted.
But I need to do an else statement for where I am updating the database to get the record id where it was just updated.
What would I use after the Updating is done to set my $userid???
Here is the snippet of code....
/ Set variable for where clause /
$Confirm_Code= $_SESSION['Confirmation_Code'] ;
/ Process as INSERT if confirm DOES NOT exist/
if (!$_SESSION['Confirmation_Code']){
$sql = mysql_query("INSERT INTO Marketing (Event, First_Name, Last_Name, Title, Company, Address_Line_1, Address_Line_2, City, State, Zip_Code, Phone, Fax, Email, Web_Page, Prd_Imaging, Prd_EMR, Prd_Appt_Schd, Prd_Billing, Prd_AR_Finan,
Prd_Docuscan, Demo_Will_Attnd, Contact_Has_Questions, signup_date) VALUES('$Event','$First_Name', '$Last_Name', '$Title', '$Company', '$Address_Line_1','$Address_Line_2', '$City', '$State','$Zip_Code','$Phone',' $Fax',' $Email',' Web_Page', '$Imaging','$EMR', '$Appt', '$Billing', '$ARFinancing', '$Docuscan','$Demo','$Questions', now())") or die (mysql_error());
$userid = mysql_insert_id();
}else {
/ Process as UPDATE if confirm DOES exist /
$sql = mysql_query("Update Marketing SET
Event='$Event',
First_Name='$First_Name',
Last_Name='$Last_Name',
Title='$Title',
Company='$Company',
Address_Line_1='$Address_Line_1',
Address_Line_2='$Address_Line_2',
City='$City',
State='$State',
Zip_Code='$Zip_Code',
Phone='$Phone',
Fax='$Fax',
Email='$Email',
WHERE Confirmation_Code ='$Confirm_Code'")
or die (mysql_error());
***Now I need to pull the row number into the $userid*