PHP crud Mysqli Select Insert Update and Delete query

PHP crud Mysqli Select Insert Update and Delete query

Today, We want to share with you PHP crud Mysqli Select Insert Update and Delete query.
In this post we will show you Mysqli Select Insert Update and Delete query, hear for Select Insert Update Delete In Php MySQLi Example we will give you demo and example for implement.
In this post, we will learn about PHP crud Mysqli Select Insert Update and Delete query with an example.

Welcome to the In Pakainfo.com website! You will Step By Step learn web programming, easy and very fun. This website allmost provides you with a complete web programming tutorial presented in an easy-to-follow manner. Each web programming tutorial has all the practical examples with web programming script and screenshots available.Mysqli Select Insert Update and Delete query

Mysqli SELECT,INSERT,UPDATE and DELETE Statement/Query

mysqli select query

$query_sql = "SELECT pageid, postname, catname,postid,postdesc FROM pakainfo";
$data_result = $conn->query($query_sql);

if ($data_result->num_rows > 0) {
    // looping through all data record output data of every row
    while($row = $data_result->fetch_assoc()) {
        echo "pageid: " . $row["pageid"]. " - postname: " . $row["postname"]. " " . $row["catname"]. "
"; } } else { echo "Not Found Data : 0 results display"; }

mysqli insert query


$sql_insert_query = "INSERT INTO pakainfo (pageid, pagename, catname)
VALUES ('p_124', 'Aboutus', 'general')";

if ($conn->multi_query($sql_insert_query) === TRUE) {
    echo "Good Luck : your New records database to created successfully..!!";
} else {
    echo "Error: " . $sql_insert_query . "
" . $conn->error; }

mysqli Update query


$sql_update_query = "UPDATE pakainfo SET postname='contactus' WHERE postid=p2458";

if ($conn->query($sql_update_query) === TRUE) {
    echo "your data Record 100% updated successfully.!";
} else {
    echo "Not Update / Error updating record are : " . $conn->error;
}

mysqli Delete query

// sql to delete a record
$sql_delete_query = "DELETE FROM pakainfo WHERE postid=p2458";

if ($conn->query($sql_delete_query) === TRUE) {
    echo "your data Record particular deleted successfully: Good luck";
} else {
    echo "Not delete record yet../ Error deleting record are : " . $conn->error;
}

Leave a Comment