Ten days to learn the third day of php objective: to learn how to build a database
In ASP, if it is an ACCESS database, you can directly open ACCESS to edit the MDB file. if it is an SQL server, you can open the Enterprise Manager to edit the SQL SERVER database, but in PHP, the command line editing of my SQL may be very troublesome for beginners. it doesn't matter. you can download and install PHPMYADMIN, and you can rely on it to create and edit a database later.
The following describes how to use it.
After entering phpmyadmin, we first need to create a database, Language (*) Here select simplified Chinese, then create a new database on the left here fill in the database name, click create.
Select the created database from the drop-down list on the left. In the following
Create a new table in the database shop:
Name:
Number of fields:
Enter the table name and the approximate number of fields you think (it doesn't matter if it is not enough or more, you can add it later or use the default value), and click execute.
Then you can create a table.
The first column is the field name, and 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
4) DATE, DATE type
5) You may ask, where is the automatically added ID? You only need to select the INT type, and select auto_increment in the additional section below.
After creating a table, you can see the table you created on the left. after clicking it, you can:
1) view and modify the table structure by structure on the right
2) click browse on the right: view the data in the table
3) press SQL on the right to run the SQL statement.
4) insert to the right: insert a row of records
5) clear by right: delete all records in the table
6) delete the table on the right: delete the table
Another important function is import and export. when the program and database are ready on the local machine, a local image is required on the server. if asp access is simple, directly upload the MDB file. if it is an SQL SERVER, you can connect to the remote SERVER for import. In my SQL, you can export all the SQL statements to PHPMYADMIN on the remote server. after creating the database, press SQL and paste all the SQL statements generated at the current level that you just copied.
Let's talk about database operations today.