$result =mysql_query("SELECT * FROM list WHERE buscat1='$category' OR buscat2='$category' OR buscat3='$category' ORDER BY name ASC",$db)
or die("lINE 8");
this gets everything in the database with the a particular catogry. And will display all hte results on one page... Now.. I need to make i grab them all...sort them alphabeticly by collum name.. then grab the first 20. that I can do kinda.. the problem lies in that I need to have a way to tell it to grab all the results with the approiate category, then sort them alphabeticly. Now... after the page with the intial 20, I need a link to the same page, but with the next 20 results.
This might be of help
Scroll down to my very last post in that thread.
$result =mysql_query("SELECT * FROM list WHERE buscat1='$category' OR buscat2='$category' OR buscat3='$category' ORDER BY name ASC LIMIT $offset, 20",$db);
Im getting an error on this
I dont have a value in offset..does that matter?
I put a value in offset.. (0) and now there is no error, but I am getting all the results..not just 20
That last sql you posted looks fine. And yes you would have to set $offset to hold a value.
LIMIT value1, value2
value1 is where to start taking results... value2 is how many to take in?
Yes that's right. Also value1 is an optional agruement. For example:
LIMIT 0, 20 <- limit to the first twenty records
LIMIT 20, 20 <- skip the first twenty records and return the next twenty.
LIMIT 20 <- no offset given, so just return the first twenty records.