ob_start();
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="cms"; // Database name
//$tbl_name="test_mysql"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Select data from table..
$sql="SELECT * FROM data";
$result=mysql_query($sql);
extract($_POST);
$count =mysql_num_rows($result);
// Check if delete button active, start this
if(isset($_POST['delete'])){
for($i=0;$i<$count;$i++){
$del_id = $checkbox[$i];
$sql = "DELETE FROM data WHERE id='$del_id'";
$reslt = mysql_query($sql);
}
// if successful redirect to delete_multiple.php
if($reslt){
header("location:deletemorerecords.php");
}
}
mysql_close();
?>
Do feel free to ask any questions that you may have concerns to web. No Compromise on Learning!
Subscribe to:
Post Comments (Atom)
How to backup and download Database using PHP
< ?php $mysqlUserName = 'databaseusername' ; $mysqlPassword = 'databasepassword' ; $mysqlHostNa...
-
Welcome to the next part of OpenLayers 3 for Beginners! If you have not worked through parts one or two yet, you can hop over to them he...
-
What is PHPSpreadSheet Library PHPSpreadSheet library is purely writter in PHP and it main purpose of communicate your PHP application with ...
-
Welcome to OpenLayers 3 for Beginners: Part 2. If you have not been to and completed OpenLayers 3 Part 1 yet, head over to http://chris...
nice.... dude
ReplyDelete