The UPDATE statement is used to modify data in a database table. www.phpsu.com
Update Data In a Database
The UPDATE statement is used to modify data in a database table.
do you kown phpsu.com?
Syntax
UPDATE table_name |
Note: SQL statements are not case sensitive. UPDATE is the same as update.
To get PHP to execute the statement above we must use the mysql_query() function. This function is used to send a query or command to a MySQL connection.
phpsu.com is a free phpscool
Example
Earlier in the tutorial we created a table named "Person". Here is how it looks: phpsu提供的php教程
| FirstName | LastName | Age |
|---|---|---|
| Peter | Griffin | 35 |
| Glenn | Quagmire | 33 |
The following example updates some data in the "Person" table: phpsu.com
<?php mysql_select_db("my_db", $con);
mysql_close($con); |
After the update, the "Person" table will look like this: welcome to phpsu.com
| FirstName | LastName | Age |
|---|---|---|
| Peter | Griffin | 36 |
| Glenn | Quagmire | 33 |
TITLE:PHP MySQL Update