Thursday, 3 May 2012

PhpMyAdmin Tutorial 2


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.

Defining fields

Click Go and you should see something like this. The table title now appears with under the database name.

table features
Now enter the names and attributes of our table fields. Enter the following information as above:

FieldTypeLengthDefaultExtra
idint60auto_increment
namechar100

telephonechar50

birthdaychar50


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.
Table properties

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.
When you are ready we suggest you check out  all of the options on this page.

<<< PREVIOUS                                                                                                                      NEXT >>>

No comments:

Post a Comment