1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<?php require("configure.php");
$ProductGradeId = $_GET["ProductGradeId"]; $ProductCatId = $_GET["ProductCatId"];
$Sort = $_GET["Sort"];
//Delete Child $sql = "DELETE FROM Product WHERE ProductGradeId=". $ProductGradeId ." "; mysql_query($sql); if( mysql_errno() > 0 ){ echo 'Product Detail Delete Error:<br />'. mysql_error() .'<br />SQL: '. $sql; exit; }
// Delete db $sql = "DELETE FROM ProductGrade WHERE ProductGradeId=". $ProductGradeId ." "; //echo $sql; mysql_query($sql); if( mysql_errno() > 0 ){ echo 'Product Category Delete Error:<br />'. mysql_error() .'<br />SQL: '. $sql; exit; } mysql_query("UPDATE ProductGrade SET Sort = Sort-1 WHERE ProductCatId = $ProductCatId AND Sort >= $Sort "); mysql_close($dbh);
header("Location: productgrade_index.php?msg=Delete Successful");
?>
|