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.
Đâ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 xem truy vấn SQL có được thực thi trong PHP không?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
2 level error is generated.$[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!"];
}
}
}];
}];
}];
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
3 on error. $[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!"];
}
}
}];
}];
}];
// peform một truy vấn ..mysql_query[] returns
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. $[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!"];
}
}
}];
}];
}];
$ 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
3 if the user does not have permission to access the table[s] referenced by the query. $[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!"];
}
}
}];
}];
}];
// Truy vấn trả về 0 hàng !.
} khác {.
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[] fails and returns
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!"];
}
}
}];
}];
}];
$[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!"];
}
}
}];
}];
}];
8Việc thực thi trả về đúng về thành công và sai về thất bại. Từ tài liệu: trả về đúng về thành công hoặc sai về thất bại. Vì vậy, một cái gì đó giống như nếu [$ sth-> thực thi [$ params]] {echo "thành công!"; } khác {echo "thất bại!"; }?
Làm thế nào để tôi biết nếu mysqli truy vấn thành công?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!"];
}
}
}];
}];
}];
9Xem 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;
}
9Delete
0
Delete
1
Delete
2
Delete
3
Delete
4
Delete
5
Delete
6
Delete
7
Delete
8
Delete
9
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
response
0
response
1
response
2
$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
response
4
response
5
response
6
response
7
response
8
response
9
ajax
0
ajax
1
ajax
2
$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 ¶
ajax
4
ajax
5
$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 ¶
ajax
7
ajax
8
ajax
9
$query
011 năm trước ¶
Ông Tim ¶
$query
1
$query
2
$query
3
$query
4
$query
5
$query
6
$query
7
$query
8
$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_identifier
0
16 năm trước ¶
Ẩn danh ¶
$link_identifier
1
$link_identifier
2
$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_identifier
4
$link_identifier
5
$link_identifier
6
$link_identifier
7
$link_identifier
8
$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!"];
}
}
}];
}];
}];
0019 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!"];
}
}
}];
}];
}];
1814 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!"];
}
}
}];
}];
}];
2322 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!"];
}
}
}];
}];
}];
2413 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!"];
}
}
}];
}];
}];
3919 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