How to run or execute multi query in mysqli PHP

+10 How to run or execute multi query in mysqli PHP $conn = mysqli_connect(“localhost”,”username”,”password”,”database_name”); /* Test Connection */ if (mysqli_connect_errno()) { printf(“Your Connection failed: %s\n”, mysqli_connect_error()); exit(); } $query = “DELETE FROM `demo_table` WHERE `mid`=’$id’;INSERT INTO `MyTable` (`firstname`, `lastname`, `emailid`) VALUES (‘Brain’, ‘Colls’, ‘[email protected]’)”; mysqli_multi_query($conn,$query); // Execute multi query at one time  

How to refresh form after submit in PHP

+10 How to refresh form after submit in PHP index.php <html> <title>Codelizar Form</title> <head> <link rel=”stylesheet” type=”text/css” href=”https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css”> <script type=”text/javascript” src=”https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js”></script> </head> <body> <form method=”POST” action=””> <div class=”row”> <div class=”col-md-3 form-group”> <label for=”username”></label> <input type=”text” value=”” name=”username” class=”form-control”> </div> <div class=”col-md-3 form-group”> <label for=”password”></label> <input type=”text” value=”” name=”password” class=”form-control”> </div> <div class=”col-md-3 form-group”> <button name=”btn_submit” …

How to upload file using php/ajax and save into database

00 How to upload a single file using PHP and save it into database Single file upload system Create a formupload.php file <head> <script src=”formajax.js”></script> </head> <form id=”codelizar_form” method=”post” enctype=”multipart/form-data”> <div class=”row”> <div class=”form-group col-md-3″> <label for=”user_name” class=”heading-2″>User name * </label> <input type=”text” name=”user_name” id=”user_name” class=”form-control” placeholder=”Enter user name” required=”required”> </div> <div class=”col-md-3″> <label for=”file_img”>Choose …

How to find out duplicate value in array PHP

+20 How to find out duplicate value in array PHP   // Create an array in PHP $data_array = array(‘laptop’, ‘mobile’, ‘computer’, ‘keyboard’, ‘laptop’, ‘mouse’, ‘printer’, ‘printer’, ‘printer’); // Now output is print_r(array_count_values($data_array)); Array ( [laptop] => 2 [mobile] => 1 [computer] => 1 [keyboard] => 1 [mouse] => 1 [printer] => 3 ) // …