carlfaulkner Posted May 24, 2012 Share Posted May 24, 2012 This is what i have but it doesnt work: WHERE isConfirmed = '1' AND category = '$category' AND CONCAT(title, description, lieuexact, city) like '%$searchQuery%' if i remove the category clause it works.i want to find all rows that are confirmed, in category 2 and title,desc, lieuexact or city fields like search field text. Any ideas.... Link to comment Share on other sites More sharing options...
niche Posted May 24, 2012 Share Posted May 24, 2012 Please post your complete mysql_query and the specific errors it produces. Link to comment Share on other sites More sharing options...
carlfaulkner Posted May 24, 2012 Author Share Posted May 24, 2012 I only have $sql = "select * from tablename ..... At the start. There is no error but when I set a certain category I don't get any results. Link to comment Share on other sites More sharing options...
niche Posted May 24, 2012 Share Posted May 24, 2012 (edited) Are you using mysql and running it in php (this is a php forum)? Edited May 24, 2012 by niche Link to comment Share on other sites More sharing options...
carlfaulkner Posted May 24, 2012 Author Share Posted May 24, 2012 Yes using php Link to comment Share on other sites More sharing options...
niche Posted May 24, 2012 Share Posted May 24, 2012 You said in post 3 that you can get the clause to work. How do you know that? Link to comment Share on other sites More sharing options...
justsomeguy Posted May 24, 2012 Share Posted May 24, 2012 If the database isn't retuning any results then it sounds like there aren't any records that match. If there were records that matched, it would return them. Link to comment Share on other sites More sharing options...
niche Posted May 24, 2012 Share Posted May 24, 2012 Carlos, have you checked for data in your sql resource? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now