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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.