Learning Purpose: Learn to build a database
In ASP, if you are an Access database you can directly open access to edit the MDB file, if it is SQL Server you can open Enterprise Manager to edit the SQL Server database, but in PHP, MY SQL command-line editing may make beginners feel very troublesome, It doesn't matter, you download a phpmyadmin to install, and later build the editing database can rely on it.
Let's talk about its use.
After entering the phpMyAdmin, we first need to set up a database,
Language (*) Here Select Chinese Simplified, and then on the left to create a new database here fill in the database name, click Create.
Then select the database that you have created in the left drop-down menu. In the following
Create a new table in the database shop:
Name:
Number of fields:
Fill in the table name and roughly what you think of the number of fields (not enough or more of it does not matter, can be added later or default), press to execute.
Then you can start building the table.
The first column is the name of the field; the second column selects the field type:
The following are some of our common uses:
1) VARCHAR, text type
2) INT, integer type
3) Float, floating-point type
4) Date, type
5) You may ask, where is the ID that is automatically added? just select the int type, and select Auto_increment in the extras below.
After you have established the table, you can see the table you created on the left, and after clicking, you can:
1) Press the structure on the right: View Modify table Structure
2) Browse by right: View the data in the table
3) Press the right SQL: Run SQL statement
4) Press Insert on right: Insert a row of records
5) on the right, clear: Delete all records in the table
6) Press DELETE on the right: Delete table
There is a very important function is import and export, when we have the program and database, we need to have a local mirror on the server, if the ASP access is simple, upload the MDB file directly, if SQL Server can also connect to the remote server for import. So in my SQL you can export all the SQL statements, to the remote server phpMyAdmin, after the database is created, press SQL, paste all the SQL statements you just copied down.
Today, we'll talk about database operations tomorrow.
10 days to learn PHP the third day in Guangdong Entertainment