Project Help Wanted
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOtherProject Help Wanted

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 January 1st, 2002, 03:52 PM
dkilburn dkilburn is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 7 dkilburn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb developing an online scavenger hunt

I hope this is an appropriate topic for this forum. It concerns a project I would like to develop for my class.

I want to create an online scavenger hunt around my class site. The students will be competing to see who can finish first. They will have to find 5 items. When they find the item, I want them to fill out a short form that will input into a mysql database the item number and a timestamp.

Each student will be submitting 5 forms (one for each item). The variable for their name would be the ID field in the database. That is, each time they submitted the form, it would enter the information in the row for that student. I think the database fields would look something like this:

Code:
ID             |   item1     |  item2      |  item3...
student code   | timestamp   | timestamp   | timestamp...

I can code forms, and I am learning PHP. What I would like is for someone to take me under their wings and guide me in setting up the database correctly as well as setting up the php coding in the forms to accomplish this task. I can create the output page with no problem. I learn very well from example, so if there is something similar already created that I can look at, I can probably figure it out from there.

Many thanks!

Debby

Reply With Quote
  #2  
Old January 1st, 2002, 04:23 PM
Sepodati's Avatar
Sepodati Sepodati is offline
Banned (not really)
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 1999
Location: Brussels, Belgium
Posts: 14,630 Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)  Folding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced Folder
Time spent in forums: 3 Months 6 Days 2 h 55 m 52 sec
Reputation Power: 4408
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
My wings are kind of full, but I can give you an idea on how to set up the database and forms.

I would have 3 tables: Users, Items, and Found.

Users:
ID - int not null auto_increment primary key
Name - varchar(20)
Password - varchar(32)

Items:
Item_ID - int not null auto_increment primary key
Item_Name - varchar(50)
Description - varchar(255)

Found
User_ID - int not null multiple key (foreign key to Users.ID)
Item_ID - int not null multiple key (foreign key to Items.Item_ID)
Time - timestamp

Add in whatever other fields you need, this is the basics.

The Found table relates each user to an item that they have found. There would be a multiple key or unique for each of them, that way the user could only have one entry in the table for each item.

In your form, you would of course ask for the username and password and probably have a drop down box for the items. You can populate the drop down box with the data in the Items table.

This is dependent on whether you want to user to see all of the items in the drop down box. Maybe they have to go in order, item1, item2, etc. In that case, you can do a COUNT(User_ID) WHERE User_ID = 'XX' from the Found table and see what item the user should be on. Then maybe ask them a question about the item to make sure they actually have it (i'm sure you would check later in person to make sure no one was cheating...)

I would record the times that the user found the item, too. That might come in handy later on for figuring the winner...

Hope that helps you. Hopefully someone else can actually help you with the code if you need it. If you come across a specific MySQL or PHP related problem, post the question in the proper forum and someone will help you.

---John Holmes...
__________________
-- Cigars, whiskey and wild, wild women. --

Reply With Quote
  #3  
Old January 1st, 2002, 05:15 PM
dkilburn dkilburn is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 7 dkilburn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the great response. Only one question (so far!).
Quote:
Originally posted by SepodatiCreations

Found
User_ID - int not null multiple key (foreign key to Users.ID)
Item_ID - int not null multiple key (foreign key to Items.Item_ID)
Time - timestamp

I am using phpMyAdmin to set up the tables. The only problem I have is setting up the User_ID and Item_ID fields. Where do I insert the "multiple key" attribute?

The items on the row are FIELD, TYPE, LENGTH/SET, ATTRIBUTES, NULL, DEFAULT, EXTRA and then checkboxes for PRIMARY, INDEX, and UNIQUE. The only fields I can type in are the LENGTH/SET and DEFAULT. I don't see "multiple key" or "foreign key" in any of the drop down menus.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherProject Help Wanted > developing an online scavenger hunt

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap