Giả sử tôi có một bảng danh mục và sau đó tôi có bảng sản phẩm.categories table and then I have products table.
Mỗi sản phẩm thuộc về một số loại.
Bây giờ, tôi muốn xóa một danh mục được gán cho một số sản phẩm.
Điều này sẽ gây ra lỗi, vì tôi không thể xóa một cái gì đó khỏi cơ sở dữ liệu vì quan hệ cơ sở dữ liệu. Mã của tôi bên dưới sẽ loại bỏ một hàng khỏi bảng (sử dụng jQuery) nhưng nó sẽ loại bỏ danh mục thực sự chỉ khi không có sản phẩm nào sử dụng nó.
Tôi đang cố gắng tạo một số cảnh báo lỗi khi tôi nhấp vào biểu tượng Delete và không thể xóa danh mục. Làm thế nào tôi có thể làm điều đó? Tôi muốn một số cửa sổ bật lên jQuery với cảnh báo, nhưng tôi không thực sự biết tôi nên kiểm tra lỗi ở nơi đầu tiên như thế nào.
EDIT: Tôi đã cố gắng sử dụng echo 1; và echo 0; là response cho ajax nhưng tôi nhận được thông báo cảnh báo mỗi khi tôi muốn xóa một cái gì đó, ngay cả khi không có lỗi. I have tried to use echo 1; and echo 0; as response for ajax but I am getting the warning message every time I want to remove something, even if there is no error.
<tbody> <?php $cat_list = "SELECT * FROM games_category"; $result = mysqli_query($conn, $cat_list); while($row = mysqli_fetch_assoc($result)) { $id = $row['id']; $name = $row['name']; ?> <tr> <td><?php echo $id; ?></td> <td><?php echo $name; ?></td> <td> <span class='delete_game_cat' id='del_<?php echo $id; ?>'><img src="../images/remove.png" alt="" title="Delete" class="icon"/></span> </td> </tr> <?php } ?> </tbody>Đây là kịch bản:
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); });Và truy vấn SQL:
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; }mwwaygoo tại hotmail dot com
10 năm trước — Send a MySQL query
Jon tại WebSandBox Dot Net
Predrag Supurovic ¶(string $query, resource $link_identifier = NULL): mixed
18 năm trước
Allen A Brooker GB NetRichie (at) Richiebartlett.com
Chris tại Hotmail Dot Com ¶
wjyong tại sh263 dot netLàm thế nào để bạn kiểm tra truy vấn SQL được thực thi hoặc không trong PHP?mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() had been called with no arguments. If no connection is found or established, an $(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 2 level error is generated.
Kiểm tra xem nếu một truy vấn SQL đã được thực thi câu trả lời mã PHP.
Làm thế nào để bạn kiểm tra xem thực thi có thành công trong PHP không?mysql_query() returns a resource on success, or $(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 3 on error.
// peform một truy vấn ..mysql_query() returns $(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 4 on success or $(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 3 on error.
$ query = "Chọn`*`từ người dùng" ;.mysql_fetch_array(), and other functions for dealing with result tables, to access the returned data.
$ results = mysqli_query ($ databaseConnection, $ query) ;.mysql_num_rows() to find out how many rows were returned for a SELECT statement or mysql_affected_rows() to find out how many rows were affected by a DELETE, INSERT, REPLACE, or UPDATE statement.
if (mysqli_num_rows ($ results) == 0) {. will also fail and return $(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 3 if the user does not have permission to access the table(s) referenced by the query.
Ví dụ
Ví dụ #1 Truy vấn không hợp lệ
Truy vấn sau đây không hợp lệ về mặt cú pháp, do đó mysql_query () không thành công và trả về $(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 3.mysql_query() fails and returns $(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 3.
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 8
Ví dụ #2 Truy vấn hợp lệ
Truy vấn sau là hợp lệ, do đó mysql_query () trả về tài nguyên.mysql_query() returns a resource.
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 9
Xem thêm
- mysql_connect () - Mở kết nối với máy chủ MySQL
- mysql_error () - Trả về văn bản của thông báo lỗi từ hoạt động MySQL trước đó
- mysql_real_escape_string () - thoát các ký tự đặc biệt trong một chuỗi để sử dụng trong câu lệnh SQL
- mysql_result () - Nhận dữ liệu kết quả
- mysql_fetch_assoc () - lấy hàng kết quả như một mảng kết hợp
- mysql_unbuffered_query () - Gửi truy vấn SQL đến MySQL mà không cần tìm nạp và đệm các hàng kết quả
Jack Dot Whoami tại Gmail Dot Com ¶ ¶
15 năm trước
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 0
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 1
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 2
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 3
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 4
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 5
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 6
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 7
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 8Halion tại Gmail Dot Com ¶ ¶
15 năm trước
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 9
Delete0
Delete1
Delete2
Delete3
Delete4
Delete5
Delete6
Delete7
Delete8
Delete9
echo 1;0
echo 1;1
echo 1;2
echo 1;3
echo 1;4
echo 1;5
echo 1;6
echo 1;7
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 8Halion tại Gmail Dot Com ¶ ¶
Nikhil-php tại Nols Dot Com ¶
echo 1;9
echo 0;0
echo 0;1
echo 0;2
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 822 năm trước ¶
Ẩn danh ¶
echo 0;4
echo 0;5
echo 0;6
echo 0;716 năm trước ¶
Ông Tim ¶
echo 0;8
echo 0;9
response0
response1
response2
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 814 năm trước ¶
Davidc tại Edeca Dot Net
response4
response5
response6
response7
response8
response9
ajax0
ajax1
ajax2
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 819 năm trước ¶
ialsoagree ¶
ajax4
ajax5
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 813 năm trước ¶
ddlshack [at] gmail.dot.com ¶
ajax7
ajax8
ajax9
$query011 năm trước ¶
Ông Tim ¶
$query1
$query2
$query3
$query4
$query5
$query6
$query7
$query8
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 814 năm trước ¶
Ẩn danh ¶
$link_identifier0
16 năm trước ¶
Ẩn danh ¶
$link_identifier1
$link_identifier2
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 816 năm trước ¶
Ông Tim ¶
$link_identifier4
$link_identifier5
$link_identifier6
$link_identifier7
$link_identifier8
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 822 năm trước ¶
Davidc tại Edeca Dot Net
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 00
19 năm trước ¶
Ông Tim ¶
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 01
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 02
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 03
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 04
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 05
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 06
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 07
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 08
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 09
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 814 năm trước ¶
Ẩn danh ¶
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 11
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 12
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 13
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 1416 năm trước ¶
Ông Tim ¶
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 15
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 16
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 814 năm trước ¶
Ông Tim ¶
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 18
14 năm trước ¶
Davidc tại Edeca Dot Net
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 19
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 20
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 21
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 819 năm trước ¶
Ông Tim ¶
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 23
22 năm trước ¶
ialsoagree ¶
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 24
13 năm trước ¶
ddlshack [at] gmail.dot.com ¶
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 25
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 26
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 27
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 811 năm trước ¶
Davidc tại Edeca Dot Net
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 29
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 30
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 31
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 32
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 33
$id = $_POST['id']; $query = "DELETE FROM games_category WHERE id =".$id; if(mysqli_query($conn, $query)){ echo 1; }else{ echo 0; } 819 năm trước ¶
ialsoagree ¶
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 35
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 36
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 37
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 3813 năm trước ¶
Davidc tại Edeca Dot Net
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 39
19 năm trước ¶
Ông Tim ¶
$(document).ready(function(){ // Delete $('.delete_game_cat').click(function(){ var el = this; var id = this.id; var splitid = id.split("_"); // Delete id var deleteid = splitid[1]; // AJAX Request $.ajax({ url: 'delete_game_cat.php', type: 'POST', data: { id:deleteid }, success: function(response){ if(response===1){ // Removing row from HTML Table $(el).closest('tr').css('background','tomato'); $(el).closest('tr').fadeOut(600, function(){ $(this).remove(); }); }else{ alert("This category cannot be deleted!"); } } }); }); }); 40