This article mainly introduces how to modify records in PHP + MySQL. The example analyzes the mysql modification record skills. For more information, see
This article mainly introduces how to modify records in PHP + MySQL. The example analyzes the mysql modification record skills. For more information, see
This article describes how to modify records in PHP + MySQL. Share it with you for your reference. The details are as follows:
The Code is as follows:
Modify record
<? Php
If (isset ($ _ POST ['btnmodify']) {
// Verification form omitted
$ SQL = "UPDATE animal SET WHERE ID = '$ _ POST [id]'";
$ Result = mysqli_query ($ SQL); // execute the update
If ($ result ){
Echo "modification successful! ";
}
Else
{
Echo "failed to modify! ";
}
}
// Query the current record
$ Query = "SELECT * FROM symbols ";
// Execute this query
If ($ result = $ mysqli-> query ($ query )){
// Display the number of returned Record Sets
If ($ result-> num_rows> 0 ){
// If a record exists
// Display the content of columns in the record set
Echo"
I hope this article will help you design the php + mysql program.
";While ($ row = $ result-> fetch_array ()){Echo"
";Echo"
| ";Echo"
| ";Echo"
| ";Echo"
| ";Echo"
";}}// Release the memory occupied by the object$ Result-> close ();}?>,