Hey again, i made a new topic since this is a new problem.
this time the problem i have is that the code bellow as before shows pictures on my page. but this page is supposed to show the latest 50, i cant figure out how to make the row of pictures be 5 per row like
[Picture 1][Picture 2][Picture 3][Picture 4][Picture 5]
[Picture 6][Picture 7][Picture 8][Picture 9][Picture 10]
[Picture 11][Picture 12][Picture 13][Picture 14][Picture 15]
i hope someone could help with this.
[CODE]<?
// Definiera konstanter för databasanslutning
$MYSQL_HOST = ‘aaa’;
$MYSQL_USER = ‘aaa’;
$MYSQL_PASSWORD = ‘aaa’;
$MYSQL_DATABASE = ‘aaa’;
// Anslut till databasen
mysql_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD);
mysql_select_db($MYSQL_DATABASE);
// Plocka ut 7 senaste MMS
$res = mysql_query(‘SELECT *,unix_timestamp(tstamp) as utstamp FROM mms
ORDER BY tstamp DESC LIMIT 50’);
echo “<table cellspacing=”3″ cellpadding=”1″ border=”2″><tr>”;
while ($row = mysql_fetch_assoc($res)) {
echo “<td>”;
$row[‘message’] = substr($row[‘message’],strpos($row[‘message’],’ ‘));
if ( file_exists(‘data/’ . $row[‘id’] . ‘.jpeg’) ) {
$row[‘picture’] = ‘data/’ . $row[‘id’] . ‘.jpeg’;
} else $row[‘picture’] = ”;
if ( $row[‘picture’] != ” ) {
echo ‘<a href=”‘.$row[‘picture’].'”OnClick=”window.open(‘.”‘”.’visabild.php?id=’.$row[‘id’].”‘”.’,null,’.”‘”.’width=593,height=721’.”‘”.’); return false;”>’;
echo ‘<img width=”125″ src=”‘ . $row[‘picture’] . ‘”></a>’;
}
echo “</td>”;
}
echo “</tr></table>”;
?>