Project Help Wanted
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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:
Anyone looking for a way to modernize legacy data or easily migrate to a more cost-effective database without sacrificing functionality will benefit from this seminar. View the Intro to Advantage Database Server now!
  #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
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Dec 1999
Location: Afghanistan
Posts: 14,360 Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)Sepodati User rank is General 9th Grade (Above 100000 Reputation Level)  Folding Points: 69352 Folding Title: Intermediate FolderFolding Points: 69352 Folding Title: Intermediate FolderFolding Points: 69352 Folding Title: Intermediate FolderFolding Points: 69352 Folding Title: Intermediate Folder
Time spent in forums: 2 Months 3 Weeks 6 Days 2 h 26 m 30 sec
Reputation Power: 1606
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...

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


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway