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.

 

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 05-27-2010, 10:52 PM   #1
lost&found
Confirmed User
 
lost&found's Avatar
 
Join Date: Sep 2008
Location: canada..............eh?
Posts: 850
need help with a MySQL query!

OK so lets say you have a table with 6 columns and you want to query with a pattern match on 4 columns. How do I do this?

I can produce accurate result with 1 column like this:

SELECT * FROM tableName WHERE name LIKE '%pattern%'

That works with one column like 'name' but if I wanted to query other columns like name,title,comment,ect how would I form this SQL statement?

details:

MySQL 5.0.77
Al cols are Latin_general_ci

Ya I am a newbie with this stuff.....

__________________
need content?

Email me for exclusive or semi-exclusive!

sandraxxsyn @gmail.com

Last edited by lost&found; 05-27-2010 at 10:54 PM.. Reason: missed info
lost&found is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 05-28-2010, 01:19 AM   #2
LoveSandra
So Fucking Banned
 
Join Date: Aug 2008
Location: Just Blow Me
Posts: 10,551
bump 4 you
LoveSandra is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 05-28-2010, 07:46 AM   #3
Spankys Teens
Confirmed User
 
Spankys Teens's Avatar
 
Join Date: May 2005
Location: The Porn Land
Posts: 1,414
[QUOTE=lost&found;17182590]

SELECT * FROM Name WHERE name LIKE '%pattern%'

That works with one column like 'name' but if I wanted to query other columns like name,title,comment,ect how would I form this SQL statement?

Try this:

SELECT Name, FROM table
WHERE CONTAINS((COLUMN NAME 1, COLUMN NAME 2), '%pattern%');
__________________
Banners - Design - TGP & more
Trade: Teenies In Action
icq: 256664696
Spankys Teens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 05-28-2010, 11:20 AM   #4
mikke
Confirmed User
 
mikke's Avatar
 
Industry Role:
Join Date: Jan 2010
Location: Europe
Posts: 1,327
..or

..WHERE CONCAT(name,title,comment) LIKE '%name%'
__________________
icq: 395 294 346
http://www.adultsubmitter.eu - submit any adult site to 20 directories from 1 form!
now 20 domains!
http://www.porndeals.eu http://www.ebonybangbros.com
mikke is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 05-28-2010, 10:28 PM   #5
Spankys Teens
Confirmed User
 
Spankys Teens's Avatar
 
Join Date: May 2005
Location: The Porn Land
Posts: 1,414
Quote:
Originally Posted by mikke View Post
..or

..WHERE CONCAT(name,title,comment) LIKE '%name%'
I forgot about CONCAT ....it's been a few years since i used SQL
__________________
Banners - Design - TGP & more
Trade: Teenies In Action
icq: 256664696
Spankys Teens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 06-09-2010, 11:42 AM   #6
fatfoo
ICQ:649699063
 
Industry Role:
Join Date: Mar 2003
Posts: 27,763
Good luck with MySQL.

I would love to believe that you are the sexy woman in your avatar.

Look! You can be multiplied by 2!



What part of Canada are you from?
__________________
Send me an email: [email protected]

Last edited by fatfoo; 06-09-2010 at 11:44 AM..
fatfoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 06-10-2010, 12:00 PM   #7
lost&found
Confirmed User
 
lost&found's Avatar
 
Join Date: Sep 2008
Location: canada..............eh?
Posts: 850
BC and I am the girl in my avatar!
__________________
need content?

Email me for exclusive or semi-exclusive!

sandraxxsyn @gmail.com
lost&found is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
 
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.