Date: 10/15/01
- Next message: Thomas \: "[PHP-DB] Re: cannot include file"
- Previous message: Nicklas Bondesson: "[PHP-DB] how to do a search in mysql database for multiple keywords??"
- Maybe in reply to: Nicklas Bondesson: "[PHP-DB] how to do a search in mysql database for multiple keywords??"
- Next in thread: Mike Patton: "RE: [PHP-DB] how to do a search in mysql database for multiple keywords??"
- Reply: Mike Patton: "RE: [PHP-DB] how to do a search in mysql database for multiple keywords??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
SELECT
<columnlist>
FROM
<tablename>
WHERE
<column to be searched>
LIKE
'%<word1>%'
AND
<column to be searched>
LIKE
'%<word2>%'
AND
<column to be searched>
LIKE
'%<word3>%'
for example...
SELECT uid, name, address, email FROM people WHERE address LIKE
'%london%' AND address LIKE '%baker%' AND address LIKE '%221b%'
In MySQL the % sign is the wildcard, so '%baker%' will look for all
instances containing baker. Similarly baker% will match all strings
starting with baker and baker% will match all strings ending in baker.
Hope this helps
Dave
-----Original Message-----
From: Nicklas Bondesson [mailto:nicklas.bondesson <email protected>]
Sent: 15 October 2001 09:06
To: php-db <email protected>
Subject: [PHP-DB] how to do a search in mysql database for multiple
keywords??
need some help on this.
any ideas??
/nicke
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Thomas \: "[PHP-DB] Re: cannot include file"
- Previous message: Nicklas Bondesson: "[PHP-DB] how to do a search in mysql database for multiple keywords??"
- Maybe in reply to: Nicklas Bondesson: "[PHP-DB] how to do a search in mysql database for multiple keywords??"
- Next in thread: Mike Patton: "RE: [PHP-DB] how to do a search in mysql database for multiple keywords??"
- Reply: Mike Patton: "RE: [PHP-DB] how to do a search in mysql database for multiple keywords??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

