I am using MS SQL for a DB and PHP on a WINDOWS server.
What i'm trying to do is the standard thign where it pulls a certian amount of items for the DB ans lists them then creates links at the bottom for different pages... i.e if i set the limit to 4 this would show 4 items on each page and create a link on the bottom for every 4 items in teh DB.
Exmaple:
News Title
News Body
News Title
News Body
News Title
News Body
News Title
News Body
Pages 1 2 3 4 MORE...
OK i can get everything to work except i cant figure out how to add the offset to this SQL statement... The offset would be the number of pages * the Limit. So if i click on the Link to page 3 it would get the 12-16 items in teh DB...
Am i making an sense here? Hee is the SQL statement i am using.
$limit = 10; // Number Of News Items Per Page
$query = " Select Top $limit vchTitle, txtSummary, txtFullArticle, intNewsID, convert(varchar(10),dtmDateAdded,1) AS DateAdded FROM tblNewsItems ORDER BY intNewsID DESC";
Now that pulls 10 items from the DB and displays them but when i click on the link for say page3 it still shows the first 10 items becasue its nopt reading the Offset.
Thanks!
π