Changeset 11390


Ignore:
Timestamp:
Jun 15, 2011, 11:27:07 PM (13 years ago)
Author:
ddtddt
Message:

[extensions] - ID_switch - update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ID_switch/admin/admin.php

    r10591 r11390  
    6161if (isset($_POST['IDS'])and is_numeric($_POST['IDS1']) and (!$_POST['IDS1'])==0 and is_numeric($_POST['IDS2']) and (!$_POST['IDS2'])==0)
    6262        {
     63       
     64$query = '
     65select id, hit, has_high, average_rate, path
     66  FROM ' . IMAGES_TABLE . '
     67  WHERE id = \''.$_POST['IDS1'].'\'
     68  ;';
     69$result = pwg_query($query);
     70$row = mysql_fetch_array($result);     
     71$id1=$row['id'];
     72$hit1=$row['hit'];
     73$has_high1=$row['has_high'];
     74$average_rate1=$row['average_rate'];
     75
     76$query = '
     77select id, hit, has_high, average_rate, path
     78  FROM ' . IMAGES_TABLE . '
     79  WHERE id = \''.$_POST['IDS2'].'\'
     80  ;';
     81$result = pwg_query($query);
     82$row = mysql_fetch_array($result);     
     83$id2=$row['id'];
     84$hit2=$row['hit'];
     85$has_high2=$row['has_high'];
     86$average_rate2=$row['average_rate'];
    6387
    6488$query = '
     
    79103        $query = '
    80104UPDATE ' . IMAGES_TABLE . '
    81   SET id= \''.$_POST['IDS1'].'\'
     105  SET id= \''.$_POST['IDS1'].'\',
     106                hit= \''.$hit1.'\',
     107                average_rate= \''.$average_rate1.'\'
    82108  WHERE id = \''.$_POST['IDS2'].'\'
    83109    ;';
     
    86112        $query = '
    87113UPDATE ' . IMAGES_TABLE . '
    88   SET id= \''.$_POST['IDS2'].'\'
     114  SET id= \''.$_POST['IDS2'].'\',
     115                hit= \''.$hit2.'\',
     116                average_rate= \''.$average_rate2.'\'
    89117  WHERE id = \''.$tempoids.'\'
    90118    ;';
Note: See TracChangeset for help on using the changeset viewer.