corecodeschool.blogspot.com: Update Query using Object Oriented Method Query in php

Enter Keyword Hear for Search This Blog

Showing posts with label Update Query using Object Oriented Method Query in php. Show all posts
Showing posts with label Update Query using Object Oriented Method Query in php. Show all posts

Tuesday, 15 September 2020

Update Query using Object Oriented Method

 Update Query using Object Oriented Method



<?php

$mysqli = new mysqli("localhost", "root", "", "Mydb"); 

if($mysqli === false){ 

    die("ERROR: Could not connect. " 

            . $mysqli->connect_error); 

} 

$sql = "UPDATE data SET Age='28' WHERE id=201"; 

if($mysqli->query($sql) === true){ 

    echo "Records was updated successfully."; 

} else{ 

    echo "ERROR: Could not able to execute $sql. ". $mysqli->error; 

} 

$mysqli->close(); 

?>


Output is :




Featured post

Contact

Contact Core Code School Core Code School shares beginner-friendly tutorials on PHP, HTML, CSS, JavaScript, Java, SQL and Ubuntu. You can...