Results 1 to 2 of 2

Thread: MySQL: ORDER BY?

  1. #1

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    MySQL: ORDER BY?

    Hey ya,

    U know how places like Yahoo!, Excite, MSN ETC all show their search results "Order of match: Highest possibility first"

    etc..

    well, how can i do it?

    Like if some1 searches "Free PHP Scripts"

    Theres a site.
    1)
    Download php scripts
    2)
    Download php
    3)
    All the best quality PHP Scripts, Free for your own use!
    it will return the results:
    3 / 1 / 2, since 3 has all the words, 1 has two, and two only has the one..

    Is this easy to accomplish or?

    i know basic "Order by ID DESC" etc,

    But i wanna totally get rid of CGI / Perl scripts, and upgrade the lot on me site to PHP (since it works alot faster, and less "Buggy" from my ex.

    Any how, sample codes (as always) would be great
    Wayne

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    There isn't a way to do it using ORDER BY, and through my SQL experience, I can't think of a way that could do it. You're probably going to have to find a way to sort through them using PHP after you've extracted them from the database.

    I've seen code before that someone posted in the VB Forums that tells you how much a string is like another string in %. Perhaps if you can find that, we can help you conver it to PHP code.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width