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
|
<?php require("configure.php");
$ProductColourId = $_GET['ProductColourId']; $Sort = $_GET['Sort']; $status = $_GET['status'];
if ($status == 'up') { $s_sign="+1"; $PCSort = $Sort-1; if ($PCSort <=0) { $PCSort = 1; } } else { $s_sign="-1"; $PCSort = $Sort+1; }
$sql = "update ProductColour set Sort='$PCSort' "; $sql .= "where ProductColourId=". $ProductColourId ." "; //echo $sql; if( mysql_num_rows(mysql_query("SELECT ProductColourId FROM ProductColour WHERE Sort=$PCSort AND ProductColourId!='$ProductColourId' ")) > 0){ mysql_query("UPDATE ProductColour SET Sort= Sort".$s_sign ." WHERE Sort = $PCSort "); } mysql_query($sql); mysql_close($dbh); //echo "<br><br>UPDATE ProductColour SET Sort= Sort".$s_sign ." WHERE Sort = $PCSort";
header("Location: productcol_index.php?msg=Update Successful"); ?>
|