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 change the PHP version for subfolders or subdomains
How to change the PHP version for subfolders or subdomains Setting a specific PHP version for a specific websites, subfolders or subdomain...
-
DDL Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples: CREATE - to create obje...
-
It gives “The filetype you are attempting to upload is not allowed.” error when I was trying to upload flv and wmv files using codeigiter...
-
DATE_SUB() Getting the recent one month or year records from MySQL table Syntax of DATE_SUB() DATE_SUB(date, INTERVAL, expression, UNIT) E...

nice.... dude
ReplyDelete