So in PHP I have the following:
$result = db_query("SELECT * FROM siteData WHERE category = '$temp_cat' ORDER BY id DESC LIMIT $offset, $rowsperpage");
// db_query() is a custom function which executes mysqli queries to the db
I'm displaying the id
in my post HTML and use it as a permalink to the post. That's all good, but when I decide to filter by category I see the following:
Main page
:-Post Title-
-2- <-- Post ID
-Post Content-
-Post Footer-
-Post Title-
-1- <-- Post ID
-Post Content-
-Post Footer-
About Page
:-Post Title-
-4- <-- Post ID
-Post Content-
-Post Footer-
-Post Title-
-3- <-- Post ID
-Post Content-
-Post Footer-
And so on... What I mean with this is that posts have misleading IDs that are set upon post creation and automatically increase. This leads to About Page
beginning with post that has id = 3
and not id = 1
. Is there any possible way to make it count IDs for different categories separately?