Jump to content


Photo

Need some help/Understanding


  • Please log in to reply
1 reply to this topic

#1 esahp

esahp
  • Members
  • PipPip
  • Member
  • 28 posts
  • LocationUSA

Posted 23 September 2006 - 07:07 AM

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:

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)

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)

To obtain peace and quiet, get a Phoneless Cord.


#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 23 September 2006 - 04:18 PM

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users