Submerged Posted December 23, 2006 Share Posted December 23, 2006 It seems like this would be a common question, but searching through the forums hasn't turned up exactly what I'm looking for. Basically, I have a table names "sites", and 2 of the columns in there are named "name", and "description". I then have a query to search for a specific term.I have the query itself down just fine, when I'm just searching the "name" column:[code=php:0]SELECT * FROM sites WHERE name LIKE '%$term[0]%' AND name LIKE '%$term[1]%' AND category IN ('1','2','3','4','5','6','7','8','9')[/code]Which works just fine, but I also need to it to search through the "description" category in the same way as the "name" one (which includes the neccesary "category IN" part).I'm relatievly new to MYSQL, so I'm not sure how to process the syntax in that, but if someone could give me a hand it would be really great :)-Alex Quote Link to comment Share on other sites More sharing options...
artacus Posted December 23, 2006 Share Posted December 23, 2006 So just change the column from "name" to "description" Quote Link to comment Share on other sites More sharing options...
Submerged Posted December 23, 2006 Author Share Posted December 23, 2006 It was a bit more than that, but since you told me about the union in the other thread i dont need this code anymore, thanks :) Quote Link to comment Share on other sites More sharing options...
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.