>Maybe I'm slow...I'm trying to decipher what you're trying to do. Show us your table 
>layout
>Show us your search criteria and code
>Show us a dump of your table so we can see what the data look like

ahhh give the chap a break, this is 4th (or so) posting. he thinks we're all 
wonderful! Let's not 
mess that up for him:

You had it when you said: "..how do I ORDER BY and then.."

SELECT * FROM <your_table> WHERE foo LIKE '%bar%' ORDER BY <some_field> LIMIT 
<some_limit>

* You could set <some_field> in your code or have it as a variable set from the 
web-page: "Click 
table headings to sort by that field" etc etc
* You could also have <some_limit> set as a number from a select menu again on the web 
page of 
search results.

Good luck!
Russ

PS Where is this search engine? can I have a look??? go on - you know it makes 
sense....

On Thu, 18 Oct 2001 12:46:25 -0500 Rick Emery <[EMAIL PROTECTED]> wrote:

> Maybe I'm slow...
> 
> I'm trying to decipher what you're trying to do.
> 
> Show us your table layout
> Show us your search criteria and code
> Show us a dump of your table so we can see what the data look like
> 
> 
> -----Original Message-----
> From: Chris Payne [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 18, 2001 12:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Order By for search results ???
> 
> 
> Hi there everyone,
> 
> I am happy, I have my search engine working almost perfectly (Touch wood :-)
> but there is one problem.  When I search - say for Backpacking in Australia
> it doesn't bring up the results in that order as I have to order by country,
> city or whatever.  What I want to know is, how do I ORDER BY and then my
> search results so that I get the nearest matches at the top of the search?
> 
> Thank you all for your help, this list is the best place to be for PHP :-)
> 
> Chris
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

#-------------------------------------------------------#
                                
  "Believe nothing - consider everything"       
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com
                        
#-------------------------------------------------------#


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to