 |
|
คือผมต้องการที่จะลบภาพออกจากฐานข้อมูลแล้วก็ในโฟล์เดอร์ด้วยผมต้องใช้คำสั่งอะไรลบ
ภาพจากโฟล์เดอร์ครับตรงในฐานข้อมูลผมลบไดแต่ในโฟล์เดอร์ผมลบไม่ได้อะครับช่วยทีครับ
อันนี้โค้ดที่ผมใช้ลบจากฐานข้อมูลครับ
Code
<?php
mysql_query('SET NAMES tis620');
mysql_query('SET collation_connection tis620_thai_ci');
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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($_POST['key_empid'])) && ($_POST['key_empid'] != "")) {
$deleteSQL = sprintf("DELETE FROM advertise_small1 WHERE `order`=%s",
GetSQLValueString($_POST['key_empid'], "text"));
mysql_select_db($database_bpcp, $bpcp);
$Result1 = mysql_query($deleteSQL, $bpcp) or die(mysql_error());
$deleteGoTo = "delete advertise small1 OK.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
$colname_advertise_small1 = "-1";
if (isset($_GET['empid'])) {
$colname_advertise_small1 = (get_magic_quotes_gpc()) ? $_GET['empid'] : addslashes($_GET['empid']);
}
mysql_select_db($database_bpcp, $bpcp);
$query_advertise_small1 = sprintf("SELECT * FROM advertise_small1 WHERE `order` = %s", $colname_advertise_small1);
$advertise_small1 = mysql_query($query_advertise_small1, $bpcp) or die(mysql_error());
$row_advertise_small1 = mysql_fetch_assoc($advertise_small1);
$totalRows_advertise_small1 = mysql_num_rows($advertise_small1);
?>
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2009-08-25 11:49:39 |
By :
rescue_o |
View :
1008 |
Reply :
11 |
|
 |
 |
 |
 |
|
|
|
 |