List:General Discussion« Previous MessageNext Message »
From:Steve Edberg Date:February 11 2000 8:26pm
Subject:Re: Starting from a certain place
View as plain text  
At 7:36 AM -0800 2/11/00, Darryl Ashton wrote:
>This message was sent from Geocrawler.com by "Darryl Ashton" 
><niteuk@stripped>
>Be sure to reply to that address.
>
>Hi,
>
>I'm perfectly able to make a MySQL query (via
>PHP) sort by date, time, name, both foward and
>descending, etc.  But is there a way to make it
>start from an entry other than the first?
>
>For example, I've got a list of products, 400 in
>total, and they've all got their own MySQL
>entries.  I want to display 20 per page, and I
>want to allow the user to choose which letter of
>the alphabet required.  So clicking on "D" would
>display all products starting from D, but
>allowing the user to go back to the previous 20,
>which would obviously contain C, and then next,
>to view E.
>
>Is this possible in an easy way?
>


Something like

	SELECT *
	FROM product_list
	WHERE name >= 'D'
	ORDER BY name
	LIMIT 20

perhaps? For case insensitivity, use

	SELECT *
	FROM product_list
	WHERE UCASE(name) >= 'D'
	ORDER BY name
	LIMIT 20

- steve

+---------------- Splurk! Glort! Klikrunk! Ploip! Katoong!---------------+
| Steve Edberg                           University of California, Davis |
| sbedberg@stripped                                     (530)754-9127 |
| Computer Consultant                         http://aesric.ucdavis.edu/ |
+------------------ Don Martin 18 May 1931 - 7 Jan 2000 -----------------+
Thread
Starting from a certain placeDarryl Ashton11 Feb
  • Re: Starting from a certain placesinisa11 Feb
  • Re: Starting from a certain placeSteve Edberg11 Feb
Re: Starting from a certain placeAlain.Tesio11 Feb