This article mainly introduces the methods for modifying records in PHP + MySQL. The example analyzes the skills for modifying records in mysql. For more information, see the example below. 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 ();}?>