We will create a table in the database, called "people". Use the Create new table feature. Type in the name of the new table into the Name: people, and the number of columns in the table (4) into Fields:. This tutorial is only designed to show you the basic php/MySQL/phpMyAdmin functions. You can delete it using the Drop function. You will want to allow for growth in your table.
Click Go and you should see something like this. The table title now appears with under the database name.
Now enter the names and attributes of our table fields. Enter the following information as above:
Field | Type | Length | Default | Extra |
id | int | 6 | 0 | auto_increment |
name | char | 100 | ||
telephone | char | 50 | ||
birthday | char | 50 |
The Length value indicates the maximum allowable length of characters for input. There are many different values that can be set for Type; see further documentation here. The Types specified in this example aren't the most efficient, but just used for the purposes of this exercise. The "id" field, which will be used as a Primary key for this table, has been set to auto_increment, saving you from having to having to type in the next number in sequence when you input records. Set the Default to 0
Once you've entered all the values, click Save. A screen like this will appear.
Congratulations!-You have created your table! The corresponding SQL command for creating these fields is also displayed. This isn't needed but in time you will start to recognise MySql commands
Note that you can use Drop to delete a table or fields.
Note that you can use Drop to delete a table or fields.
No comments:
Post a Comment