![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Registered User
Join Date: Jun 2003
Posts: 51
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
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.
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Registered User
Join Date: Jun 2003
Posts: 51
|
thanks a lot for helping out bro, its working now thanks to you ;)
Jon |
![]() |
![]() ![]() ![]() ![]() ![]() |