I am trying to compose an email content with heredoc. I have no idea how to access variables stored from some previous sql queries and insert them into the text.
Here's the sql queries:
$week=mysql_query('SELECT `Name`, `fname`, `Marca` FROM `personal` WHERE (`Responsabil`='.$id.') AND (`Protectie`>="'.$CurrentDate.'") AND (`Protectie`<"'.$WeekDate.'") AND (`Notificat`!=1)');
$exp=mysql_query('SELECT `Name`, `fname`, `Marca` FROM `personal` WHERE (`Responsabil`='.$id.') AND (`Protectie`<"'.$CurrentDate.'") AND (`Notificat`!=1)');
$week=mysql_fetch_assoc($week);
$exp=mysql_fetch_assoc($exp);
and the problem:
$content=<<<EMAIL
We inform you that the following people:
$week['Name'] $week['fname']
$exp['Name'] $exp['fname']
are due for inspection.
EMAIL;
I need to insert here all the names resulted form the queries. The queries are tested and working.