How to modify records with PHP+MySQL, modify records with phpmysql_PHP tutorial

WBOY
Release: 2016-07-13 10:09:29
Original
1044 people have browsed it

How to modify records with PHP+MySQL, modify records with phpmysql

The example in this article describes the method of modifying records with PHP+MySQL. Share it with everyone for your reference. The details are as follows:

Copy code The code is as follows:

Modify record


If(isset($_POST['btnModify'])){
//Verification form omitted
          $sql = "UPDATE animal SET WHERE ID = '$_POST[id]'";
          $result = mysqli_query($sql); //Perform update
If($result){
echo "The modification has been successful!";
                                                                                                                          else  
                                                                                   echo "Modification failed!";
                                                                                                              }  
//Query the current record
$query = "SELECT * FROM symbols";
//Execute the query
If($result = $mysqli->query($query)){
//Display the number of rows in the returned record set
If($result->num_rows>0){
//If there is a record
//Display the contents of the record set columns
echo "";
​​​​​​while($row=$result->fetch_array()){
echo "";
                        echo "";
                       echo "";
                       echo "";
                       echo "";
echo "";
                                                                                                                                                                                                                                              //Release the memory occupied by the object
         $result->close();
}  
?>



I hope this article will be helpful to everyone’s php+mysql program design.

http://www.bkjia.com/PHPjc/945697.html

www.bkjia.com

truehttp: //www.bkjia.com/PHPjc/945697.htmlTechArticleHow to modify records with PHP+MySQL, modify records with phpmysql. This article describes the method of modifying records with PHP+MySQL. Share it with everyone for your reference. The details are as follows: Copy the code The code is as follows...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template