|
 |
|
ทำไงดีเวลา run มันฟ้องว่าdeleteได้ แต่ไปดูในฐานข้อมูลมันยังไม่delete ให้ทำไงอ่ะค่ะ ช่วยหน่อยด่วนๆๆๆ |
|
 |
|
|
 |
 |
|
มันยังไม่ query เลยหะครับ
|
 |
 |
 |
 |
Date :
2009-04-09 13:33:58 |
By :
teez1232002 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง echo $DOC_ID ดูก่อนนะว่ามีค่าไหม
ถ้า $DOC_ID มีค่าแล้ว ที่ if(mysql_query($sql,$conn)) บรรทัดนี้
ลองเอา $conn ออกดูนะ => if(mysql_query($sql))
|
 |
 |
 |
 |
Date :
2009-04-09 13:46:42 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
mysql_query($sql,$conn);
if(mysql_affected_rows($conn)){
echo "update completed.";
}
?>
|
 |
 |
 |
 |
Date :
2009-04-09 14:32:55 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้ Update ดีกว่าไม๊ค่ะ
Transection ก้อยังอยู่ ด้วยค่ะ
เรา Update status จาก 0 เป็น 1 ทำนองนี้ก้อได้ค่ะ
มันมีประโยชน์ในการดึง Report มาดู Status ด้วยนะเราว่า
===แนะนำเฉยๆ ค่ะ===
|
 |
 |
 |
 |
Date :
2009-04-09 14:44:58 |
By :
paphun |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช้าไปมะเนี้ยเรา ...
Code (PHP)
<?php
$DOC_ID=$_POST['DOC_ID'];
require('conn_mysql.php');
if($DOC_ID==""){
echo "โปรดระบุหมายเลข Doc_ID";
exit;
}
$sql="DELETE from document where DOC_ID='$DOC_ID'";
$query=mysql_query($sql,$conn);
if(mysql_fetch_rows($query)) {
echo"<font color=\"#0066CC\"><H3>ลบข้อมูลเรียบร้อยแล้ว!!</H3></font>";
echo"<br><br><td> <a href=\"list.php\">แสดงข้อมูล</a></td>\n";
} else {
echo"<font color=\"#0066CC\"><H3>ไม่สามารถลบข้อมูลได้</H3></font>";
echo "<font color=\"#0066CC\"><a href = list.php> กลับหน้าหลัก</a>";
}
mysql_close($conn);
?>
ลองแบบนี้ดูนะครับ (มาช้าไปมะเนี้ยเรา )
|
 |
 |
 |
 |
Date :
2009-04-09 15:09:48 |
By :
noomna19 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากๆค่ะ สำหรับคำแนะนำ ของทุกคน แก้ได้แล้วค่ะ อิอิ
|
 |
 |
 |
 |
Date :
2009-04-09 15:24:13 |
By :
Pizz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|