![]() |
Mysql SELECT Help needed
first of all my script is a perl script. It takes a query in the environment and cuts it into exactly what i want. Can be a combination of up to 3 search terms and a category. There is no problem there.
On my SELECT part for my query, something goes wrong. All my terms are always perfect whether only 1 or 3 or even none are present. Here is what i have: SELECT * FROM Table WHERE description like '%$search%' OR description like '%$search2%' order by ID limit 0,144; When i have only 1 search term its fine, when i have 2 or 3 it messes up, have no idea why. Anyone might know? Jon |
Try printing out the query, as it's seen by MySQL:
$query = "SELECT * FROM Table WHERE description like '%$search%' OR description like '%$search2%' order by ID limit 0,144" print "query: $query\n"; Also what does "it doesn't work" mean? Do you get an error message? If so, what does it say? DO you just not get the results you expected? I suspect that if you read the query that gets printed aloud and translate it into English you'll see where your problem is. I could just tell you, but I'd rather teach you how to find it. |
thanks a lot for helping out bro, its working now thanks to you ;)
Jon |
All times are GMT -7. The time now is 11:03 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123