I磛e created a database with several tables. Each one of them has a field with the type datetime that holds the date when the post was created.
Now I wan磘 to echo the 5 latest created posts.
I have no problem doing this from ONE of my tables, but how do I do when I want the 5 latest created posts in all of the tables in one list?
This is how I do with one table:
<?php
$connect=@mysql_connect("localhost","user","");
$databas=mysql_select_db("dbname");
$resultat=mysql_query("SELECT * FROM table1 order by datum desc limit 5");
while($rad=mysql_fetch_array($resultat)) {
?><font size="1" face="verdana,arial">
<?=$rad["fieldname1"]?><br>
<?}
mysql_close($anslut);
?>
Sorry for my bad english ;-)
//Jessica
Now I wan磘 to echo the 5 latest created posts.
I have no problem doing this from ONE of my tables, but how do I do when I want the 5 latest created posts in all of the tables in one list?
This is how I do with one table:
<?php
$connect=@mysql_connect("localhost","user","");
$databas=mysql_select_db("dbname");
$resultat=mysql_query("SELECT * FROM table1 order by datum desc limit 5");
while($rad=mysql_fetch_array($resultat)) {
?><font size="1" face="verdana,arial">
<?=$rad["fieldname1"]?><br>
<?}
mysql_close($anslut);
?>
Sorry for my bad english ;-)
//Jessica