Hi, I'm trying to get in my homepage the last 10 product-schedules inserted in my website. These I should get from different tables in my database, that have all the same fields but every table has a different kind of product.
So, I should virtually join all the tables and then get of these the 10 tables with the most recent date.
The problem is that I'm able to do this, but just on one table:
I guess I should use the 'join' command but I have no idea how…
some advice?
thanks a lot
So, I should virtually join all the tables and then get of these the 10 tables with the most recent date.
The problem is that I'm able to do this, but just on one table:
Code:
require("db/db.php");
$lastinserted=mysql_query("SELECT img,link,numclick,description,order FROM $table1 ORDER BY date DESC, order LIMIT 0,1",$link);
while ($row=mysql_fetch_array($lastinserted,MYSQL_NUM)) {
printf("<div class='grid_8'><div class='screen'>%s</div><div class='text'><h2>%s<span class='visite'> - %s visite</span></h2> %s</div></div>", $row[0], $row[1], $row[2], $row[3]);
}
mysql_free_result($lastinserted);
mysql_close($link);
some advice?
thanks a lot
Comment