-
last 3 added
Okay I have a page with three 1 cell tables. Also i have a mysql database with a column called "Title" and 1 called "id" which is auto-increment. I want to get the last last 3 id in the database and put each of those 3 "Titles" in each table I have. Know I don't know how to get all of the last 3 and each title in each table. Plz help me :)
-
Like this:
Code:
$result = mysql_query("SELECT * FROM table ORDER by id DESC LIMIT 3 ");
if ($record = mysql_fetch_array($result)) {
do {
echo $record['id'] . "<br>\n";
} while ($record = mysql_fetch_array($result));
} else {
echo "No records found!";
}
Or something to that extent.
-
Thanks I think it will work great. :)