MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 6th, 2008, 10:55 PM
Aetius Aetius is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 6 Aetius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 4 sec
Reputation Power: 0
User input --> product recommendation

I'm designing a site for a pilates instructor friend of mine. It's my first site so I'm learning a lot on the fly. So far this little project has taught me a usable amount of HTML, CSS, PHP, mySQL and JavaScript, so those are the tools I have at my disposal. What I want to do is set up a page that gives the visitor a series of questions with selectable answers (stuff like "Describe your fitness level: Out of shape, exercise occasionally, exercise regularly", etc) and based on the responses give a recommendation for what class they should register for. I'm not sure how best to go about it though. My initial thought was to create a SQL table (so Class A would have attribute "fitness" as "exercise regularly" if it was right for someone who exercised regularly) and then based on the visitor's input run a query that grabbed any class that met all of their answers. I ran into the problem that I wasn't sure how to handle it if a given class was applicable to more than one answer for a given question. I then considered programing methods for a PHP script, but nothing particularly elegant jumped out at me.

Anyway, I'm rambling now and I think I've described the problem well enough, any suggestions on methods would be greatly appreciated.

Reply With Quote
  #2  
Old July 7th, 2008, 02:57 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 22nd Plane (15500 - 15999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 15,956 Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 3 Weeks 5 Days 14 h 30 m 32 sec
Reputation Power: 1524
Making your first site for someone other than yourself.... oy!

Anyway... I'd use a comma or semi-colon separated list of values.

Then you can do something like this:
Code:
$key = 'exercise regularly';

// RLIKE is case-insensitive by default
$result = mysql_query('SELECT count(id) FROM blog_post_table '.
  ' WHERE category_tags RLIKE \'(^|,)'.$key.'(,|$)\'');

Since this is a server-side issue...
** Moved to MySQL Forum **
__________________
Spreading knowledge, one newbie at a time.

Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions

Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

I'm looking for new clients.

Reply With Quote
  #3  
Old July 7th, 2008, 03:28 PM
Aetius Aetius is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 6 Aetius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 4 sec
Reputation Power: 0
Quote:
Originally Posted by Kravvitz
Making your first site for someone other than yourself.... oy!


It's actually easier than I thought it was going to be. The hardest parts were designing the interfaces she would use on her end to interact with the site (edit her schedule, choose which client testimonials show up on the site, etc). In any event she's easily impressed and I need to build a portfolio if I'm ever going to get paid for this type of work, so it was a win-win arrangement.

Thanks for the advice, it looks like it will do nicely. I'll be sure to put the site up on the critique forum when I finish it so I can learn as much from the experience as possible.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > User input --> product recommendation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT