| Whether you are an experienced web | | | | age, than you would need five (5) fields. Simply |
| programmer or a complete novice attempting to | | | | enter the number 5 in the appropriate box. Once |
| provide data interactivity with your web site, | | | | you hit create, the system will create a table and |
| MyQSL is an easy to use and free database | | | | will add those fields into the table for you. |
| solution that can allow you to store and configure | | | | Dont worry about the number of fields |
| data to be displayed on your web site. | | | | you might need right now, as you can always add |
| The best way to create and manage a MySQL | | | | or delete fields later. |
| database is to download an open source (free) | | | | Step Three: Defining Fields |
| program called PhpMyAdmin. PHPMyAdmin allows | | | | Once you have created your table you will be |
| you to manage all aspects of both your database | | | | prompted to tell the database what features that |
| structure and data from one easy to use | | | | you want each field to have. This looks |
| interface. This tool is intended to handle the | | | | complicated, but its not if you select your |
| administration of MySQL over the Web. | | | | data type from the information below. You |
| This tool provides an interface that allows you to | | | | basically have to decide between three common |
| create and drop databases, create, drop, or alter | | | | data types and select the best choice for storing |
| tables, delete, edit, or add fields, execute any | | | | your data. If you make a mistake you can go |
| SQL statement, manage keys on fields, manage | | | | back and edit the field. |
| privileges, and import and export data into various | | | | If the field is to be used to store numbers, here |
| formats. That sounds like a complicated set of | | | | are some choices: |
| activities, but the easy to use graphical tools | | | | TINYINT A very small integer. The signed |
| make things quite simple and easy to understand. | | | | range is -128 to 127. |
| If you make a mistake, the software even | | | | SMALLINT - A small integer. The signed range is |
| provides instructions on where you made your | | | | -32768 to 32767. |
| error. | | | | MEDIUMINT - A medium-size integer. The signed |
| For a complete demo see: [ | | | | range is -8388608 to 8388607. |
| For documentation visit: | | | | INT - A normal-size integer. The signed range is |
| Most Linux based web hosting companies provide | | | | -2147483648 to 2147483647. |
| PhpMyAdmin as a standard feature with their | | | | BIGINT A very large integer. |
| packages. It is also available in a | | | | Some other less common number options include: |
| Windows IIS version. If your | | | | FLOAT- A floating-point number. |
| hosting provider does not already have this | | | | DOUBLE A double-precision floating-point |
| product installed they will often install it for you, or | | | | number. |
| even allow you to install it yourself. Setup is quick | | | | DECIMAL - A packed exact fixed-point number. |
| and easy if you follow the step-by-step installation | | | | If the field is to be used to store text or both |
| documentation. | | | | text and numbers combined, here are some |
| Step One: Creating your new database | | | | choices: |
| When you log in to your PhpMyAdmin welcome | | | | VARCHAR is for varying characters and can be |
| page, the first step is to enter a name for your | | | | up to 255 characters in length. |
| new database in a text box provided. You can | | | | TEXT is a column with a maximum length of |
| name your database anything that you wish, | | | | 65,535 characters easy to search. |
| however if you are creating the database to use | | | | BLOB is a column with a maximum length of |
| with a script or software package that you | | | | 65,535 characters case-sensitive. |
| purchased somewhere, the script provider will | | | | If the field is to be used to store dates, here are |
| often suggest a preferred | | | | some choices: |
| database name. | | | | DATE - A date. |
| You should always create your database using the | | | | DATETIME - date and time combination. |
| following format:username_ databasename | | | | TIMESTAMP - useful for recording the date and |
| Example: myusername_mydatabase | | | | time of an INSERT or UPDATE operation. |
| Your complete database name should always | | | | TIME - A time. |
| begin with your username followed by an | | | | Once you have selected the data type for your |
| underscore, then followed by the database name. | | | | fileds you will need to let the system know how |
| This allows the server to know which user is in | | | | many characters that you will need to store in |
| control of the new database, and it will also | | | | the field. |
| provide permission to access the database to | | | | Example: if you are storing a username, you |
| only specific users. This also allows different users | | | | might want to select VARCHAR as your data |
| on the same server to use the same name for | | | | type and allow up to 100 characters for that field. |
| their own database, as you did, without interfering | | | | If you are creating a User Identification number |
| with your data that is helpful if more than | | | | you might want to select INT and allow up to six |
| one user on your server bought similar software | | | | characters that would allow you to have |
| for their own site. They can then also use the | | | | up to 999,999 users. |
| software providers preferred | | | | The last step to creating your data fields is to |
| database name. | | | | select any special attributes that you may find |
| Step Two: Creating a table for your new | | | | helpful. |
| database | | | | Some examples are: |
| After you have created a database, the next | | | | Auto Increment: Auto-Increment fields are useful |
| step is to create a table, or even multiple tables, | | | | for assigning unique identification numbers for |
| for you to store data. A table is the part of your | | | | users, products, and customers, etc. By default, |
| new database that actually stores data. | | | | fields are incremented using number characters |
| You create a table by selecting the database that | | | | (like "1", "2"). |
| you created from the drop box list of databases. | | | | Primary Key: The primary key is a data column |
| Once a database is selected a new form appears | | | | that uniquely identifies a specific instance of that |
| and asks for you to create a new table. | | | | data. At least one of your fields must be a |
| You must decide what you want to name your | | | | Primary Key. Username is an example of a good |
| table and enter that name into the name box. Try | | | | primary key. You do not want to have more than |
| to choose a name that reflects the type of data | | | | one individual having the same username. |
| that will be stored in the table, such as orders, | | | | Index Key: Allows you to speed up searches by |
| users, or inventory. | | | | designating a field as a preferred data source, |
| You then must decide how many | | | | especially when combining data from multiple |
| fields or columns of data that you | | | | tables. |
| want to store for each record. If you need for | | | | Congratulations, once you have completed these |
| the table to store five (5) different items, such as | | | | steps you are ready to import data into your |
| username, users email address, users telephone | | | | new database. |
| number, users account number, and the users | | | | |