Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 5th, 2002, 01:43 PM
Padriac Filch Padriac Filch is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 19 Padriac Filch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 10 m 39 sec
Reputation Power: 0
Send a message via ICQ to Padriac Filch
Database structure for small student registration system

I am currently doing webpage work for a small management learning institute. I already have the PHP written to interact with my SQL database. Meaning that I can insert the given data into a database. However, when you come to register it will not be automatic. We will receive the contact information (name, address, phone, email, etc... as well as educational background, work experience, how you heard about us, etc...). Then after reviewing it send you information about payment and student number and so forth.

Currently I store all of the information in a contact table, then have to manually copy the same information into a registered table, and manually create student number and username for the person at that time.

I would like to know if there is a better way to organize the table structure (I'm sure there is), and if possible a way to create both a student number and a username automatically. I just recently graduated and this is my first major project and wanted to have the structure well laid out in case the enrollment of the insitute ever becomes large.

Any suggestions are welcome, or if you can point me to any resources that would be great.

Thanks

Padriac

Reply With Quote
  #2  
Old July 7th, 2002, 10:42 PM
Padriac Filch Padriac Filch is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 19 Padriac Filch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 10 m 39 sec
Reputation Power: 0
Send a message via ICQ to Padriac Filch
Anyone? Would there be a better forum for this?

Reply With Quote
  #3  
Old July 8th, 2002, 03:37 PM
Waltjp's Avatar
Waltjp Waltjp is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: NJ, USA
Posts: 91 Waltjp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 8 sec
Reputation Power: 7
Do you retain old contact information?

Sounds like you could get by with a second table for registered students. The second table might be as simple as a student number and name to link it to the first table.
__________________
- Walt

Will code for food.

Reply With Quote
  #4  
Old July 9th, 2002, 01:51 AM
ajaypatil ajaypatil is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Osaka
Posts: 9 ajaypatil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 21 sec
Reputation Power: 0
I think what you are doing is correct i.e keep the
contacts table and registered table separate.

I feel you should be able to move record from Contacts
table to Registered users table through a PHP script
rather than manually.

So you should be able to browse through the records
in the Contact table, select any one, and then click
on a Register button that would trigger a php script
that copies that record from contact table to the
registered users table. The record should then be
deleted from the Contacts table.

Ajay

Reply With Quote
  #5  
Old July 9th, 2002, 09:15 AM
Padriac Filch Padriac Filch is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 19 Padriac Filch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 10 m 39 sec
Reputation Power: 0
Send a message via ICQ to Padriac Filch
Waltjp - I will most likely be keeping the old contact information in case for some reason there applicant status changes and they need to be re-contacted.

ajaypatil - I do like your idea, and appreciate your support, however I am not sure I have the skills as of yet to produce what you are suggesting. I was hoping to use PHPMyEdit to view and make changes to the DB (I will not always be the one doing the editing so it would be nice to use). However I think this prog only operates on single tables at a time.

Perhaps someone knows of a better program, or can suggest an addition that can help with this problem.

BTW I have renamed my tables to Applicants and Registered, figure it makes more sense this way.

Last edited by Padriac Filch : July 9th, 2002 at 09:28 AM.

Reply With Quote
  #6  
Old July 9th, 2002, 07:56 PM
ajaypatil ajaypatil is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Osaka
Posts: 9 ajaypatil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 21 sec
Reputation Power: 0
Padriac,

It is not very difficult. And you will enjoy writing the script.
Maybe you can try something simpler to start with.

What you can do is write a script that takes the unique key
of an applicant, say name as input.. and then copy the
record from Applicants table to Registered table.

To copy the record, you simply have to first select record
from Applicants table, read the values of all columns and
then do the insert accordingly.

Something like this will work:
Code:

$sql = SELECT * FROM APPLICANTS WHERE NAME = $name";
$result = mysql_query($sql);

while ($row = mysql_fetch_object($result)) {
    $first_name = $row->first_name;
    $last_name = $row->second_name;
    //..... etc for all columns.
}

mysql_free_result($result);

mysql_query("INSERT INTO REGISTERED_USERS VALUES
                       ('$first_name', '$last_name', ... etc for all columns");


After that, you can try the next step to show all applicants
in a webpage, select one of them and click on Register button.
There are lot of PHP tutorials on web.

Have fun,
Ajay

Reply With Quote
  #7  
Old October 17th, 2002, 05:46 PM
Eepē's Avatar
Eepē Eepē is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 39 Eepē User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 48 sec
Reputation Power: 6
Why not just have a "registered" column in a single "students" table that gets "checked" ("1") if the student is registered? No need for multiple tables or complicated PHP scripts to copy everything between tables.

Reply With Quote
  #8  
Old October 17th, 2002, 07:11 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Ya, it would really be smarter not to duplicate your data. That's the whole reason for a relational database, after all. What happens when a student's contact info changes?

I say one table for contact info, and one table for student info. Then reference the contact info for each student from the student info table.

Reply With Quote
  #9  
Old October 17th, 2002, 09:37 PM
Eepē's Avatar
Eepē Eepē is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 39 Eepē User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 48 sec
Reputation Power: 6
The info in the "contacts" and "students" ("applicants" and "registered") tables is the same, however--hence the data duplication and my suggestion.

Reply With Quote
  #10  
Old October 17th, 2002, 11:08 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Exactly

Reply With Quote
  #11  
Old October 18th, 2002, 02:02 PM
Eepē's Avatar
Eepē Eepē is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 39 Eepē User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 48 sec
Reputation Power: 6
Um, then why did you suggest 2 tables?

Reply With Quote
  #12  
Old October 18th, 2002, 07:02 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Ah, sorry, mis-read your post.

Padriac talks about a student number, username, and payment info. A second table would be necessary for that info.

As for duplicating the data in the contact info, that would be rather silly.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Database structure for small student registration system


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 |