I was getting ready to post a new topic until I saw this one.
This fits right in with my question!
If needed please move this to a new topic.
I have discussed many times before about my prev/next links and
auto-inc vs deletion problems, but this time I narrowed it down to
one specific section of code that once I get it correct, should do the trick!
Lets say I have a news table, with each news article having ID field as Auto-Inc.
Then I have 100 records, but deleted records 80-90.
So now my auto-inc has 1-79 and 91-100
Using typical code as below to generate a Next link, it will count UP from the last
ID shown....
Code: Select all
if($bash < $total_bashs){
$next = ($bash + 1)
echo " <a href=\"$url/display$seono$next\">Next->></a><br />";
}
Of course, of last ID shown is 79, then it won't correctly display any more past that.
I finally figured this out by changing it to
Code: Select all
if($bash < $total_bashs){
$next = ($bash + $row['id']);
echo " <a href=\"$url/display$seono$next\">Next->></a><br />";
}
but still can't figure out how to change the
to correctly show the ACTUAL ID of the next article.
Im sure its an extremely simple solution, but i just don't have a simple mind!
Possibly just changing the
+?
Any suggestions?
p.s....
not implying any helpers to this prob having simple minds
