where - MySQL - Is it possible to use LIKE on all columns in a table? -


i'm trying make simple search bar searches through database words. possible use attribute without using where? want search columns keywords, not one. have this:

mysql_query("select * shoutbox name '%$search%' ") 

which searches names search input. tried both of these:

mysql_query("select * shoutbox '%$search%' ") mysql_query("select * shoutbox * '%$search%' ") 

and neither worked. possible or there way go it?

you might want @ match() function eg:

select * shoutbox  match(`name`, `foo`, `bar`) against ('$search') 

you can add boolean mode this:

select * shoutbox  match(`name`, `foo`, `bar`) against ('$search') in boolean mode 

you can relevance scores , add fulltext keys speed queries.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -