I am having problems deleting entries from a database using the following code
Code: Select all
case "deletevehicle":
// Delete the vehicle from the database.
$deletevehicle = deleteVehicle($id);
// Return to the vehicle list.
$vehiclelist = selectSiteCars(0);
$message = "Vacancy Deleted!";
$template = "vehiclelist.php";
break;Code: Select all
function deleteVehicle($id) {
global $conn;
$id = sqlInjectionProtect($id);
$sql = mysql_query("DELETE FROM
site_cars
WHERE site_cars.car_id = '$id'") or die(mysql_error());
return($sql);
}I have tried searching for a solution to this on google etc but can't solve the problem, so if anyone has any ideas or could point me in the right direction then i would be very grateful.
many thanks in advance
Code: Select all