By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,614 Members | 1,674 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,614 IT Pros & Developers. It's quick & easy.

SQL SELECT, selecting data within a cell

P: n/a
I guess this is more sql than php, but there doesn't seem to be an
appropiate sql ng,
so anyway,
I am trying to find the SQL command that does something like:
$query = "SELECT filename FROM main WHERE keywords CONTAINS '$keywords' ";
ie, I want it to return "filename" when the data in field "keywords" is eg
"grass trees flowers" and someone searches with $keyword = "grass"
but I can't find what to replace CONTAINS with.
Any sugestions?
cheers, mark.

Jul 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

On 15-Aug-2003, "Mark" <ma***********@NOSPAMyahoo.co.uk> wrote:
I am trying to find the SQL command that does something like:
$query = "SELECT filename FROM main WHERE keywords CONTAINS '$keywords' ";
ie, I want it to return "filename" when the data in field "keywords" is eg
"grass trees flowers" and someone searches with $keyword = "grass"
but I can't find what to replace CONTAINS with.
Any sugestions?
cheers, mark.


select filename from main where keywords like '%grass%' ...

if you have multiple keywords to search on use AND or OR e.g.
select filename from man where keywords like '%grass%' and keywords like
'%green%'

--
Tom Thackrey
www.creative-light.com
Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.