ปุ่ม Delete ไม่ลบข้อมูลที่เลือก

ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา ปุ่ม Delete ไม่ลบข้อมูลที่เลือก

ปุ่ม Delete ไม่ลบข้อมูลที่เลือก
คลิกปุ่ม Delete แล้วขึ้น alert ว่า Delete Succesfuly แต่ข้อมูลไม่ลบ เป็นเพราะอะไรคะ
------------ Delete.php ------------------
<meta charset=utf-8" />

<?php include('connection.php');  //ไฟล์เชื่อมต่อกับ database ที่เราได้สร้างไว้ก่อนหน้าน้ี
	//สร้างตัวแปรเก็บค่าที่รับมาจากฟอร์ม
	$groupID = $_GET['groupID'];

	//ลบข้อมูลออกจาก database ตาม groupID ที่ส่งมา
	$sql = "DELETE FROM user_group, permission_module
			USING user_group
			INNER JOIN permission_module
			WHERE user_group.groupID ='$groupID'
			AND permission_module.groupID = user_group.groupID"
			or die("Error:" . mysqli_error($conn));
	$result = mysqli_query($conn, $sql) or die ("Error in query: $sql " . mysqli_error());
 
	//จาวาสคริปแสดงข้อความเมื่อบันทึกเสร็จและกระโดดกลับไปหน้าฟอร์ม	
	if($result){
	echo "<script type='text/javascript'>";
	echo "alert('Delete Succesfuly');";
	echo "window.location = '3.php'; ";
	echo "</script>";
	}
	else{
	echo "<script type='text/javascript'>";
	echo "alert('Error back to delete again');";
	echo "</script>";
}
?>
--------------------------- Delete Modal -----------------------
    <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h6 class="modal-title" id="deleteModalLabel"><b>ยืนยันการลบข้อมูล</b></h6>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                </div>
                <div class="modal-body">
                    คุณต้องการลบกลุ่มผู้ใช้นี้หรือไม่</div>
                <div class="modal-footer">
                    <form class="form-horizontal" role="form" method="post" action="Delete.php?groupID=$row[0]" enctype="multipart/form-data">
                        <button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button>
                        <button class="btn btn-primary" type="submit">Delete</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
------------------ ปุ่ม opn modal delect -----------------------------

                                                <button class="btn btn-datatable btn-icon btn-transparent-dark" type="button" data-toggle="modal" data-target="#deleteModal">
                                                    <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2">
                                                        <polyline points="3 6 5 6 21 6"></polyline>
                                                        <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
                                                        <line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line>
                                                    </svg>
                                                </button>


14. 203.130.153.xxx 14-12-2020 10:12:40

คำแนะนำ และการใช้งาน

สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก


  • ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
  • เปลี่ยน


    ( หรือ เข้าใช้งานผ่าน Social Login )

 ความคิดเห็นที่ 1
ดูลิ้งค์นี้เป็นแนวทาง

http://niik.in/que_2398_5642


บทความแนะนำที่เกี่ยวข้อง
แนวทางตรวจสอบ error การเชื่อมต่อ และการคิวรี่ข้อมูลจาก databaseอ่าน 43,267
Ninenik 171.97.98.xxx 14-12-2020






เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ