-2
$aux = mysql_num_rows($sql2);
$html = '';
$html .= '<table border="1">';
$html .= '<tr>';
$html .= '<td colspan="3"><b><Center>'.$row[0].' </center></b></td></tr>';
$html .= '<tr><td align="center"><b>Instalador</b></td>';
$html .= '<td bgcolor="#A9A9A9" align="center"><b>Morada</b></td>';
$html .= '<td align="center"><b>Email</b></td>'
</tr>';
for($i=1; $i<=$aux; $i ++){
$sql = mysql_query("SELECT *
from Tabela WHERE id = $id = ".$i) or die(mysql_error());
$row=mysql_fetch_array($sql);
$html .= '<tr><td>'.$row[0].'</td>
<td>'.$row[1].'</td>
<td>'.$row[2].'</td>
<td>'.$row[3].'</td>
</tr>';
}
$html .= '</table>';
I’m having a problem putting background color on these two lines:
$html .= '<td bgcolor="#A9A9A9" align="center"><b>Morada</b></td>';
Here on this I would like to put a rule because you will receive dates. If the date is already passed the rectangle is red.
<td>'.$row[2].'</td>
I don’t understand what the doubt is.
– Jorge B.
The syntax of your code is wrong...
– gmsantos
Wrong because? This data will be exported to Excel
– ChrisAdler
Rephrase the question when possible because it is complicated to have to guess what you meant. You cite that you have "a problem with putting background color on these two lines" and on the next line you place the code where you enter the tag of a spine in a PHP variable. Where are the two lines? <td> is different from line.
– Adriano Leal