Jump to content

Recommended Posts

I am building a website that does the following.

 

User signs up via sign up form and that info is put into a database table. We can call the table Clients.

 

Once they sign up they are prompted to pay for the services.

 

Once they pay via paypal. The info is sent to a script that uses paypal IPN. On successful payment the script updates the database with a temp generated password and sets the field active to "TRUE" and then emails the user their temp password.

 

This all works.

 

The next part is where my question comes in...

 

The services that are provided involve the user filling out info and submitting it to the database and then later being able to print it out.

 

There are two sections that they need to fill out. Section 1 we will call Basic Questions. Section 2 we will call Analysis.

 

My Question is what is the best practice for this?

 

Should I create a separate tables that will collect info for Section 1 and Section 2 (for a total of 3 tables including clients)

 

OR

 

Should I just add the fields that are needed to the current table  "clients" that collects the initial sign up info?

 

If the answer is option 1 when the user signs up I just need to create a script that will create a new field in the database table "Basic Questions" and "Analysis" with an identifier like ID right? So that all 3 tables have the same ID?

 

Am I far off?

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/153538-php-mysql-advice/
Share on other sites

I wud prefer option 1

 

Even better is if u can store the questions into a table

and the test names into another table

 

This way, u can add more tests / questions.

 

Of course u would have to devise a way of saying which questions are of which type

 

bool (yes/No, True/False)

Single Anser options

Multiple choice

essay

 

But that gets its own complexities. But in the end shud prove very flexible.

 

 

Link to comment
https://forums.phpfreaks.com/topic/153538-php-mysql-advice/#findComment-806787
Share on other sites

So maybe just 2 total tables?

 

Table1 = 'Clients'  stores initial sign up info. Ex. Name, Email, Address, username etc.

 

Table2 - 'Answers' stores answers to questions asked in Basic Questions and Analysis

 

The questions asked in both sections should produce different data. Sometimes numeric sometimes alpha numeric.

Link to comment
https://forums.phpfreaks.com/topic/153538-php-mysql-advice/#findComment-806813
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.