Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-03-2004, 10:18 AM php/mysql help
Junior Talker

Posts: 1
Trades: 0
I am fairly new at php and need a bit of help. I am creating a website for my wife. She sells quilting fabric. I have created a database in MySQL to store my fabric data that my wife is going to enter in. She wants to enter up to 4 colors that are on the fabric so I created fields called color1, color2, color3, color4. She uses drop downlists to make it easy for her and to avoid syntax errors. If a customer wants to search for fabric with, say Blue, I know how to set up the Select/From/Where statements...but what if they want to search for fabric with blue and green? Or blue, green, yellow, etc...I am not sure how to have it search for those colors in the 4 individual color fields I have created. Do I need to restructure my database a different way? Thanks for the help every one!!

Mike
mdojet is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-03-2004, 12:04 PM
Skilled Talker

Posts: 75
Location: New Jersey, USA
Trades: 0
Sane DB, just add 'OR' clauses to your selects...

select * from mytable where fabric = 'squares' AND (color = 'blue' OR color = 'gree' OR color='yellow');

You'll have to compose the query with more or less clauses depending on what the client is looking for.
__________________

Please login or register to view this content. Registration is FREE

Where you can get personal, online!
eBlush_Hector is offline
Reply With Quote
View Public Profile Visit eBlush_Hector's homepage!
 
Reply     « Reply to php/mysql help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31369 seconds with 12 queries