View difference between Paste ID: UmgWpe2T and ifT9VnhD
SHOW: | | - or go back to the newest paste.
1
############### Code
2
3
<?php
4
5
$host="localhost"; // Host name 
6
$username="emma01_sitetos"; // Mysql username 
7
$password="password"; // Mysql password 
8
$db_name="emma01_sitetoss"; // Database name 
9
$tbl_name="domains1"; // Table name  
10
11
// Connect to server and select database.
12
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
13
mysql_select_db("$db_name")or die("cannot select DB");
14
15
// get value of id that sent from address bar 
16
$id=$_GET['listing_days'];
17
18
// Delete data in mysql from row that has this id 
19
$sql="DELETE FROM $tbl_name WHERE id='listing_days'";
20
$result=mysql_query($sql);
21
22
// if successfully deleted
23
if($result){
24
echo "Deleted Successfully";
25
echo "<BR>";
26-
echo "<a href='abdu_delete.php'>Back to main page</a>";
26+
echo "<a href='delete.php'>Back to main page</a>";
27
}
28
29
else {
30
echo "ERROR";
31
}
32
?> 
33
34
<?php
35
// close connection 
36
mysql_close();
37
?>