|
Update statement is used to modify the data in a database table. The general syntax is as under. Syntax UPDATE tablename SET columnname = newvalue WHERE columnname = value Example: Table Name(empinfo)
FirstName
| LastName
| Email
| DOB
| Steve
| Martin
| smart.steve@studiesinn.com
| 08-04-1988
| David
| Fernandas
| davidfernandas@studiesinn.com
| 04-16-1977
| Ajay
| Rathor
| ajayrathor@studiesinn.com
| 08-24-1986
|
$con = mysql_connect("localhost:3306","adam","123456"); if (!$con) { die('Could not connect: ' . mysql_error());
} mysql_select_db("mydb", $con); $result = mysql_query("Update empinfo Set DOB=’07-05-1988’ where FirstName=’Steve’"); mysql_close($con); ?>
FirstName
| LastName
| Email
| DOB
| Steve
| Martin
| smart.steve@studiesinn.com
| 07-05-1988
| David
| Fernandas
| davidfernandas@studiesinn.com
| 04-16-1977
| Ajay
| Rathor
| ajayrathor@studiesinn.com
| 08-24-1986
|
|