Ok, on the side of my website I have a navi bar. When I click Home it goes to news.php. I want home to appear like this Home (# of post).
Is there any way to just put the number of the last post id in???
Adding up all tables in a database
Moderator: General Moderators
-
kkurkowski
- Forum Commoner
- Posts: 53
- Joined: Mon Dec 09, 2002 4:44 pm
- Location: Michigan
assuming that your id's are auto incremented, you could run a query like
this will get the id of the most recently entered item in the database.
Code: Select all
$query = "SELECT MAX(id) FROM news_news";
$result = mysql_query($query);
$result = mysql_fetch_row($result);
$newest_id = $result[0];