function destinations(){
global $db;
$numri1 = $db->query("SELECT * FROM destinations WHERE direction='1';");
$i = 1;
while ($row = mysql_fetch_array($numri1)) {
if ($i % 2 != "0") # An odd row
$rowColor = "bgC1";
else # An even row
$rowColor = "bgC2";
$direction1 .= '<tr class="'.$rowColor.'">
<td>'.$i.'</td>
<td>'.$row['name'].'</td>
</tr>';
$i++;
}
$table1 = '<table width="30%" style="margin:10px 10px 0 10px;" class="extra" cellspacing="1" cellpadding="5" border="0" >
<tr class="bgC3" style="font-weight:bold;>
<td>asd</td>
<td>Qytetet domestike</td>
</tr>
'.$direction1.'
</table>';
return $table1;
}
这一定有一个小问题,因为当它在浏览器中显示时,它会显示:
<tr class="bgC3" style="font-weight:bold;>
<td>asd</td>
<td>Qytetet domestike</td>
</tr>
好吧,它显示了它,但它取代了“asd”和“Qytetet domestike”的值!