-2
$sql = ("SELECT nome, datas FROM tabelas WHERE datediff(now(), data) <= 10 ");
$validade = mysql_query($sql);
while....
(codigo phpmailer)
// corpo da mensagem
$PHPMailer->Body = "<p>Faltam 10 dias ou menos para terminar a data do Documento ".$Nome."</p>";
I need the message to show me the name and date that is less than 10 days to finish that is inserted in the comic.
I tried to test with just the name and it doesn’t work either.
$PHPMailer->Body = "<p>Faltam 10 dias ou menos para terminar a data do Documento ".$Nome."</p>";
Name is empty or html is not displayed?
– rray
Could you please clarify your question? It is unclear whether the problem is SQL or PHP.
– Emerson Rocha
If you can, put how you are treating the query return. It can often be a null or uninitialized variable. Use the error_reporting(E_ALL) is a good alternative to prevent mistakes go unnoticed.
– mend3
Make sure the query is returning something; Make a separate test; You can put dynamic values at will. Just use how you are doing or insert {} into the variable ('{$name}').
– touchmx
The name is blank. I ask '.$Name.' and show me '..'
– ChrisAdler
@user3253195 Can you place the complete query that is being performed? It is not clear whether the fields you are trying to use are actually collected in the query. On the other hand, how does the query get to the variable
$Nome
you’re working the data?– Zuul
But when asking for names and dates in the query I can’t get the name? I already update
– ChrisAdler