I’m just trying to put together a simple HTML email confirming an order to my database.
My $message looks a little like:
$message = "
<html>
<head>
<title>Whatever</title>
</head>
<body>
etc etc
</body>
</html>
";
What i want to do within the $message HTML is make a call to my database which will return rows something like:
$emailinfo=mysql_fetch_assoc($result) or die(mysql_error());
To which i can then use in my $message along the lines of:
<p><?php echo $emailinfo['customername'];?></p>
There’s nothing wrong with my query or my tables etc, the problem i’m having and need help with is getting the results from mysql_fetch_assoc into my $message html.
Can anyone help?
Thanks
Dan
You can do something like this:
Example:
There are several other ways to achieve this. For more information, see http://php.net/manual/en/language.types.string.php.
Loop example: