The simple examples of how to delete data from Database is
<?php
$Host = "localhost";
$User = "root";
$Pass = "";
$Name = "your databaseName";
$con = mysql_connect($Host, $User, $Pass);
$db = mysql_select_db($Name, $con);
$sql = "DELETE FROM `table_name` WHERE `id` = '2' ";
//you can use this
//$sql = "DELETE FROM `table_name` WHERE `name` = 'Yourname'";
$result = mysql_query($sql);
?>
<?php
$Host = "localhost";
$User = "root";
$Pass = "";
$Name = "your databaseName";
$con = mysql_connect($Host, $User, $Pass);
$db = mysql_select_db($Name, $con);
$sql = "DELETE FROM `table_name` WHERE `id` = '2' ";
//you can use this
//$sql = "DELETE FROM `table_name` WHERE `name` = 'Yourname'";
$result = mysql_query($sql);
?>
No comments:
Post a Comment