Johnnikins
03-08-2008, 06:50 PM
Okay, i have a delete script which should work
<?php
$hostname = "localhost";
$db_user = "*******"; // change to your database password
$db_password = "*******"; // change to your database password
$database = "*******"; // provide your database name
$db = mysql_connect($hostname, $db_user, $db_password);
mysql_select_db($database,$db);
$ref = $_GET['RefNum'];
$ok = @mysql_query("DELETE FROM ads WHERE REFNUM='$ref");
if ($ok) {
echo("Advert Deleted");
} else {
echo('<p>Error deleting from database!<br />'.
'Error: ' . mysql_error() . '</p>');
}
?>
I go to delete it and it says deleted, yet when i check to see if it has deleted it hasn't
Help please?
also here is my table structure if it is any help
http://feudel.co.uk/images/advertise/uploads/img4895fddd094f9saga.PNG
<?php
$hostname = "localhost";
$db_user = "*******"; // change to your database password
$db_password = "*******"; // change to your database password
$database = "*******"; // provide your database name
$db = mysql_connect($hostname, $db_user, $db_password);
mysql_select_db($database,$db);
$ref = $_GET['RefNum'];
$ok = @mysql_query("DELETE FROM ads WHERE REFNUM='$ref");
if ($ok) {
echo("Advert Deleted");
} else {
echo('<p>Error deleting from database!<br />'.
'Error: ' . mysql_error() . '</p>');
}
?>
I go to delete it and it says deleted, yet when i check to see if it has deleted it hasn't
Help please?
also here is my table structure if it is any help
http://feudel.co.uk/images/advertise/uploads/img4895fddd094f9saga.PNG