السلام عليكم ..
مشكلتي بسيطة ..
عندي اكثر من مفتاح اساسي في الجدول
وهم
room_code
from
to
لان اختيار الغرف او حجزها يعتمد علي التاريخ ايضا ولا يتكرر
ما اريد فعلة علي الكود التالي هو اضافة from و to علي الـ 'room_code'
اي عندما يمسح يمسح عندما 'room_code' = from = to
if ((isset($_GET['room_code'])) && ($_GET['room_code'] != "")) {
$deleteSQL = sprintf("DELETE FROM tbl_rooms WHERE room_code=%s",
GetSQLValueString($_GET['room_code'], "text"));الكود كامل
<?php require_once('Connections/GoldenCityTravel.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if ((isset($_GET['room_code'])) && ($_GET['room_code'] != "")) {
$deleteSQL = sprintf("DELETE FROM tbl_rooms WHERE room_code=%s",
GetSQLValueString($_GET['room_code'], "text")
);
mysql_select_db($database_GoldenCityTravel, $GoldenCityTravel);
$Result1 = mysql_query($deleteSQL, $GoldenCityTravel) or die(mysql_error());
}
$deleteGoTo = "list_rooms.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
?>