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!
Thursday, July 29, 2010
PHP Login script tutorial..
Overview | |||||||||||||||||||||
|
What are the difference between DDL, DML and DCL commands?
DDL
Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
- CREATE - to create objects in the database
- ALTER - alters the structure of the database
- DROP - delete objects from the database
- TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
- COMMENT - add comments to the data dictionary
- RENAME - rename an object
DML
Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:
- SELECT - retrieve data from the a database
- INSERT - insert data into a table
- UPDATE - updates existing data within a table
- DELETE - deletes all records from a table, the space for the records remain
- MERGE - UPSERT operation (insert or update)
- CALL - call a PL/SQL or Java subprogram
- EXPLAIN PLAN - explain access path to data
- LOCK TABLE - control concurrency
DCL
Data Control Language (DCL) statements. Some examples:
- GRANT - gives user's access privileges to database
- REVOKE - withdraw access privileges given with the GRANT command
TCL
Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
- COMMIT - save work done
- SAVEPOINT - identify a point in a transaction to which you can later roll back
- ROLLBACK - restore database to original since the last COMMIT
- SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use
Subscribe to:
Posts (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...