jbwebdesign Posted December 20, 2011 Report Posted December 20, 2011 hello everyone....i was wondering if someone can help me out with this..... i am trying to create a search query but it doesn't seem to be working properly..... i want it to search all of the columns in the database for something LIKE the posted search data. here is my code.... $sql = "SELECT * FROM " . TABLE_NEW_SEARCH . " WHERE name LIKE '%$search%' OR first_name LIKE '%$search%' OR last_name LIKE '%$search%' OR city LIKE '%$search%' OR province LIKE '%$search%' OR country LIKE '%$search%' OR industry LIKE '%$search%' OR pro_des LIKE '%$search%' OR about LIKE '%$search%' OR strengths LIKE '%$search%' OR orgs LIKE '%$search%' OR my_website LIKE '%$search%' OR about_my_company LIKE '%$search%' OR program LIKE '%$search%' ORDER BY paid_membership DESC LIMIT $start, $limit"; for some reason this doesn't do what i'm looking for. can anyone help me with this? all i want to do is find a good way to search all the fields for something similar to the typed in phrase. Quote
jmb272 Posted December 28, 2011 Report Posted December 28, 2011 Do you get an error message? Also can you post the context which this query is executed? as in the code surrounding the SQL in the PHP script. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.