If you want to update the data then follow the below steps

step 1: First of all create a new php file. step 2: Include database connection file in this file (click here)

step 3: Create a variable in php with any name which is named as $result in the below code.

step 4: $result = mysqli_query(connection variable, query); write this code

step 5: (connection variable,query) Before this you have to name a variable, when your database connection file was created at that time your $conn = mysqli_connect(‘localhost’,’root’,”,’tablename’); Enter the name of the variable that was set while typing this.

step 6: In place of query you have to enter this code “UPDATE `tablename` SET `columns name` = ‘new name’ WHERE `tablename`.`columns no` = ‘new no’; ”

step 7: To check whether our document has been updated or not, enter if($result==TRUE){ echo “success”; }else{ echo “fail”; } code

<?php inlucde("connection.php");                                                             $$result = mysqli_query($conn,"UPDATE `tablename` SET `columns name` = 'new name' WHERE `tablename`.`columns no` = 'new no';
");
if($result==TRUE){
    echo "success";
}else{
    echo "fail";
}

?>
HTML

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *