MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:SGreen Date:June 8 2005 7:58pm
Subject:RE: Are partial searches possible?
View as plain text  
Here are the string functions. LIKE and RLIKE are useful for partial 
string searches:
http://dev.mysql.com/doc/mysql/en/string-comparison-functions.html

RLIKE uses a variation of regular expressions. Here is the syntax MySQL 
uses:
http://dev.mysql.com/doc/mysql/en/regexp.html

This section describes FULLTEXT searches (what you can and cannot do):
http://dev.mysql.com/doc/mysql/en/fulltext-search.html

Finally, here is that part of the book that covers WHERE clauses:
http://dev.mysql.com/doc/mysql/en/select.html

Basically it says that you can use any valid function (other than the 
aggregate functions) or expression in the WHERE clause of a query.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

"Don" <donpro@stripped> wrote on 06/08/2005 03:45:55 PM:

> Maybe a good question to ask is where can I find documentation on:

> MySQL WHERE where_definition

> Specifically, all the options available for the 'where_definition'

> -----Original Message-----
> From: Don [mailto:donpro@stripped]
> Sent: Wednesday, June 08, 2005 3:40 PM
> To: mysql@stripped
> Subject: RE: Are partial searches possible?

> 
> Tried that but no luck.

> What I want is a search that will look for '150000' (for example) in the
> field BOOKING.

> So if I enter '1' in my search field, it will find all instances of 
BOOKING
> with a '1' in it.

> Conversely, if I enter '12345' in my search field, it will find all
> instances of BOOKING with a '12345' in it.

> Hence, partial matches

> Thanks,
> Don

> -----Original Message-----
> From: Gordon Bruce [mailto:gordon@stripped]
> Sent: Wednesday, June 08, 2005 3:31 PM
> To: Don; mysql@stripped
> Subject: RE: Are partial searches possible?

> 
> You can try

> if($queryID = mysql_query("SELECT *
> FROM   WhInventory
> WHERE  Booking like ('%150000%')
> ORDER BY Booking",$dbLink))
> 
> -----Original Message-----
> From: Don [mailto:donpro@stripped]
> Sent: Wednesday, June 08, 2005 1:44 PM
> To: mysql@stripped
> Subject: Are partial searches possible?

> Using MySQL 4.0.24 with PHP 4.3.11

> I have the following code:

> if($queryID = mysql_query("SELECT * FROM WhInventory WHERE
> Match(Booking)
> AGAINST ('" . mysql_escape_string($form['booking']) . "' IN BOOLEAN
> MODE)
> ORDER BY Booking",$dbLink)) {

> Which works fine if I have an exact entry but fails for a partial entry. 
For
> example. If I have an entry where "Booking" is 'TSIN150000' and I search 
on
> the string 'TSIN150000', it is found.

> How can I get it to find a partial match if the string I enter is only
> '150000' ?

> Thanks,
> Don

> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=1

> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1

> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1

> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
Thread
Are partial searches possible?Don8 Jun
RE: Are partial searches possible?Gordon Bruce8 Jun
  • RE: Are partial searches possible?Don8 Jun
    • RE: Are partial searches possible?Don8 Jun
      • RE: Are partial searches possible?SGreen8 Jun
RE: Are partial searches possible?Jay Blanchard8 Jun
RE: Are partial searches possible?Jay Blanchard8 Jun