Aldark Posted September 1, 2008 Share Posted September 1, 2008 I have a question. I have a form that I am storing submitted referrals in MySQL; at the same time I need to email the values to my client. I can do both individually, but cannot wrap my head around combining them into one action. This is my insert code and I want those values passed through to email. $sql = "INSERT INTO tbl_referral ( fname, lname, phone, phonetype, email $addl_insert_crit ) valueS ( '$fname', '$lname', '$phone', '$phonetype', '$email' $addl_insert_values )"; if ($sql_debug_mode==1) { echo "<BR>SQL: $sql<BR>"; } $result = mysql_query($sql,db()); Any thoughts or ideas would be great. Thanks Link to comment https://forums.phpfreaks.com/topic/122173-require-two-events-from-form-submission/ Share on other sites More sharing options...
Psycho Posted September 1, 2008 Share Posted September 1, 2008 Simply add the code to send the email after the code to insert the record into the database (or vice versa). //Insert into database $sql = "INSERT INTO tbl_referral (fname, lname, phone, phonetype, email $addl_insert_crit) VALUES ( '$fname', '$lname', '$phone', '$phonetype', '$email' $addl_insert_values )"; if ($sql_debug_mode==1) { echo "<BR>SQL: $sql<BR>"; } $result = mysql_query($sql,db()); //Send email //....Code for email goes here Link to comment https://forums.phpfreaks.com/topic/122173-require-two-events-from-form-submission/#findComment-630757 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.