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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-23-2004, 11:52 PM   #1
archael
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
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2004, 11:58 PM   #2
raymor
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

Last edited by raymor; 09-24-2004 at 12:01 AM..
raymor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-24-2004, 12:52 AM   #3
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
thanks a lot for helping out bro, its working now thanks to you ;)

Jon
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.