Hi:
I'm a bit new to php snytax. I have a database with news enteries in it. For example, let's say i have 100 enteries, each with a unique ID between 0-99. Currently I have it set so that it goes into the DB, gets the number of enteries (in this case 99), and sets that number to $num. I then run a while loop
while ($i < $num) { $newsquery="SELECT * from news where ID = $i;
(Followed by HTML for my loop)
}
It works great. My question though, is let's say I only want to display the last 20 enteries (ID num 79-99). How would I go about doing that. I tried setting $i to ($num-20) but that doesnt seem to work. I also tried a for loop, didnt have any luck.
Any help would be appreciated.
Thanks you in advance.