10 days Learn PHP Day 3

web front end five thousand five hundred and twenty-three 13 years ago (2011-04-08)

Learning purpose: learn to build data base

On ASP In the case of ACCESS database, you can directly open ACCESS to edit the MDB file. In the case of SQL SERVER, you can open Enterprise Manager to edit the SQL SERVER database. However, in PHP, command line editing of MY SQL may be very troublesome for beginners. Never mind. You can download a PHPMYADMIN and install it. It can be relied on to create an editing database in the future.

Let's talk about its use.
After entering phpmyadmin, we first need to create a database. Language (*) selects Simplified Chinese here, and then fill in the database name in the left to create a new database. Click Create.

Then select the created database from the left drop-down menu. Below

Create a new table in the database shop:
First Name:
Number of fields:

Fill in the table name and the approximate number of fields you think (it doesn't matter if there are not enough or more fields, you can add them later or default), and press Execute.
Then you can start creating tables.
The first column is the field name; The second column selects the field type:
We usually use the following:
1) VARCHAR, text type
2) INT, integer type
3) FLOAT, floating point type
5) You may ask, where is the ID automatically added? You only need to select the INT type and auto_increment in the following extras.

After creating a table, you can see the table you created on the left. After clicking, you can:
1) Press the right structure: View and modify the table structure
2) Browse by right: View the data in the table
3) Press the SQL on the right: run the SQL statement
4) Insert by right: insert a row of records
5) Clear by right: delete all records in the table
6) Delete by right: Delete table

Another important function is import and export. When we have finished the program and database, we need to The server There is also a local image on the. If ASP ACCESS is simple, you can upload the MDB file directly. If SQL SERVER is available, you can also connect to the remote server for import. Then you can export all the SQL statements in MY SQL, go to the remote server's PHPMYADMIN, create the database, press SQL, and paste all the SQL statements generated at this level that you just copied.

That's all for today, and we will continue to talk about database operations tomorrow.