_Chris Posted May 10, 2015 Share Posted May 10, 2015 //make connection with mysql and select the database$mysql_connect = mysql_connect($host, $mysql_user, $mysql_password) ;if(!$mysql_connect) {echo ("<P>Connection issues. No results displayed.</P>");}$db_select = mysql_select_db($mysql_db);if(!$db_select) {echo ("<P>Connection issues. No results displayed.</P>");}$subject = "Subject Text";$body = "Body text;$event_date = '2015-01-31'; //Y-m-d FORMAT but I would also like to put into the email at the beginning:Hi first_name, (with the comma and then a couple of line spaces within the $body)In the mysql the first name is listed as first_name, so I would want the email to automatically insert the recipients first name at the beginning, at the top of the email. How do you do that please?Dez. Link to comment https://forums.phpfreaks.com/topic/296173-what-extra-code-is-needed-please/ Share on other sites More sharing options...
ginerjm Posted May 10, 2015 Share Posted May 10, 2015 Do a query to retrieve the user's name fields. Start the body variable with the "Hi (name_field),\n\n" and then add more text to that message body. PS - You really should be using a different sql interface since MYSQL_* functions are all DEPRECATED. Please refer to the manual if you don't believe me. IMHO - you should learn PDO. Link to comment https://forums.phpfreaks.com/topic/296173-what-extra-code-is-needed-please/#findComment-1511304 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.