Jump to content

Need some help/Understanding


esahp

Recommended Posts

So I'm trying to learn MySQL, I'm in phpmyadmin, got my database created, now I'm at tables and fields. What does it mean by fields? I'm very new to MySQL. (i'll be doing the coding in PHP, by the way.) Basically, I'm creating a signup system. Users will signup with a form, and that data will get stored in a MySQL database, for later viewing and sorting.
The signup system has 3 key pages.
Pending: All new signups will be shown here. With the option to Accept/Reject each one.

Accepted: All accepted signups will be shown here. If the Accept button is hit on a signup on the Pending page, it will be moved from Pending to this page.

Rejected: All rejected signups will be shown here. If the Reject button is hot on a signup on the Pending page, it will be moved from Pending to this page.

The form seeks the following information:
[list]
First Name (textbox)
Last Name (textbox)
Email (textbox)
Phone Number (textbox)
City/State (textbox)
Country (textbox)
Domain (textbox)
Username (textbox)
Password (textbox)
I agree with the rules (checkbox)
I agree with the legal information (checkbox)
I am atleast 18 years old (checkbox)
Site Details (textbox)
Where did you hear about us? (textbox)
[/list]

I think after I can get past how many fields and columns or whatnot I need I can handle it, but concept of how MySQL works is still confusing for me. (how it stores the data, tables, fields, etc)
Link to comment
Share on other sites

Example:

You create table called "users"

In users table you create columns (or fields - thats the same) for each separated info you want to store in the users table.

This is an example of what "users" may look like, but ideal it should contain even more info
-----------------------------------------------
| id | username | name | email | approved |
-----------------------------------------------

where the sql could look like this

`id` int(11) NOT NULL auto_increment,
`username` varchar(30) collate latin1_danish_ci NOT NULL default '',
`name` varchar(30) collate latin1_danish_ci NOT NULL default '',
`email` varchar(30) collate latin1_danish_ci NOT NULL default '',
`approved` int(1) collate latin1_danish_ci NOT NULL default '',
  PRIMARY KEY  (`id`)


Now, for each user that signs up, one row of info will be added with this structure containing datas added by e.g. PHP

You will however learn more by using the manual at www.mysql.com
Link to comment
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.