tommy1987
02-06-2007, 04:56 AM
I have an array in PHP and am passing it to a function. Now, I want to query the database with all of the keywords in the array to find a match containing all of these keywords at any place in a database column.
I need the SQL all in one statement though, is there something like:
$sql = "SELECT * FROM tbl WHERE col1 like "%word1" AND col1 like "%word2""
etc, the only problem is, it is not known how large this array will be, is there a way to get around this?
If php answer is not known, no problem, please provide some sort of SQL which you think I need and I will try and incorporate it into my database/application.
Thanks very much
I need the SQL all in one statement though, is there something like:
$sql = "SELECT * FROM tbl WHERE col1 like "%word1" AND col1 like "%word2""
etc, the only problem is, it is not known how large this array will be, is there a way to get around this?
If php answer is not known, no problem, please provide some sort of SQL which you think I need and I will try and incorporate it into my database/application.
Thanks very much