hello,
i want to extract the last eight entries from my database and print them into a 2 columns table!like this:
|1|2|
|3|4|
|5|6|
|7|8|
is that possible?
this is my code:
$db = new Database(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
$db->connect();
$sql = "SELECT ID, movieno
FROM movies
ORDER BY ID DESC
LIMIT 8 ";
$rows = $db->query($sql);
print '<table width="307" border="0" cellspacing="5" cellpadding="4">';
while ($record = $db->fetch_array($rows)) {
$vidaidi = $record['movieno'];
print <<<END
<tr>
<td>
<a href="http://www.dadadada.com/watch?v=$vidaidi" target="_blank">
<img src="http://img.dadadada.com/vi/$vidaidi/1.jpg" width="123" height="80"></a>
</td>
</tr>
END;
}
print '</table>';