JennyG Posted February 13, 2007 Share Posted February 13, 2007 Hi, I am new to PHP and MySQL and cant find an answer to my question. I know how to add info from a form to MySQL and also to send the form info to email. But how can I take the form info and send it to bouth MySQL and by mail at the same time? Jenny Link to comment https://forums.phpfreaks.com/topic/38285-form-to-bouth-mysql-and-email/ Share on other sites More sharing options...
JasonLewis Posted February 13, 2007 Share Posted February 13, 2007 just run both things in the script. mail(); mysql_query(); of course add your parameters. Link to comment https://forums.phpfreaks.com/topic/38285-form-to-bouth-mysql-and-email/#findComment-183473 Share on other sites More sharing options...
JennyG Posted February 13, 2007 Author Share Posted February 13, 2007 :-[ Thanks for your reply Hmm. that easy :-[ What is best to run first? Jenny Link to comment https://forums.phpfreaks.com/topic/38285-form-to-bouth-mysql-and-email/#findComment-183475 Share on other sites More sharing options...
JasonLewis Posted February 13, 2007 Share Posted February 13, 2007 either i would say. i personally run the query first. but thats just me. you can do any of them first. its wouldnt make a difference. Link to comment https://forums.phpfreaks.com/topic/38285-form-to-bouth-mysql-and-email/#findComment-183481 Share on other sites More sharing options...
Lodar Posted February 13, 2007 Share Posted February 13, 2007 If for example someone added an article via your form to the database and the email was a confirmation the article was added. I would add to the database first, and if no errors adding the article to the database then send the email, otherwise don't send it. It really depends on what the relationship between the data entry in the database and the purpose of the email is. Link to comment https://forums.phpfreaks.com/topic/38285-form-to-bouth-mysql-and-email/#findComment-183482 Share on other sites More sharing options...
JennyG Posted February 13, 2007 Author Share Posted February 13, 2007 Thank you all for your help, this is not for any purpose realy, I am just try to learn I will play with it and maybee I will add some more questions later (probable). Jenny Link to comment https://forums.phpfreaks.com/topic/38285-form-to-bouth-mysql-and-email/#findComment-183492 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.