Reputation: 21162
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;
}
There must be a small problem with this because when its displayed in browser it doest show this:
<tr class="bgC3" style="font-weight:bold;>
<td>asd</td>
<td>Qytetet domestike</td>
</tr>
well, it shows it but it replaces the values the "asd" and "Qytetet domestike"!
Upvotes: 0
Views: 166