Jump to content

What extra code is needed please?


_Chris

Recommended Posts

   //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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.