Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT 2 columns?

Status
Not open for further replies.

JimJx

Technical User
Feb 16, 2001
202
0
0
US
Hi all,
I have what I hope is a simple question....

I have a table with several columns, the 2 I am concerned with at the moment are Category and Keywords.

I need to search both of these columns for a word or short phrase that I get from a form.

For example, the search can be 'Antiques' or 'Antique Dealers'

I tried to use this
Code:
SELECT name, address, city, phone
FROM valley
where keywords like '%$search%'
OR category like '%$search%'
ORDER BY name LIMIT %d,%d"

in several different ways but no joy.

Any help?

Thanks!
Jim

 
From me, of course! :)

Just means not working correctly.

An old fighter pilot term that meant they hadn't spotted the enemy even though they were told the enemy was around.....
 
aaaarrh, me manual has no "not working properly" error message either

ye be walkin the plank now fer sure

r937.com | rudy.ca
 
When I use that snippet of code, I will get any matches from 'keywords' but nothing from category, even though I know there is a category with the var in it....

Example:
If the form passes 'auto' and I have an entry in keywords for 'auto dealers' and a category for 'auto repair', I will get the auto dealers, but not the auto repair.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top