Jump to content

Recommended Posts

Posted

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.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...