Ignore:
Timestamp:
Oct 19, 2013, 8:17:10 PM (11 years ago)
Author:
mistic100
Message:

replace some mass_updates/inserts by single_update/insert

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_modify.php

    r25005 r25019  
    115115if (isset($_POST['submit']))
    116116{
    117   $data =
    118     array(
    119       'id' => $_GET['cat_id'],
    120       'name' => @$_POST['name'],
    121       'comment' =>
    122         $conf['allow_html_descriptions'] ?
    123           @$_POST['comment'] : strip_tags(@$_POST['comment']),
    124       );
     117  $data = array(
     118    'id' => $_GET['cat_id'],
     119    'name' => @$_POST['name'],
     120    'comment' =>
     121      $conf['allow_html_descriptions'] ?
     122        @$_POST['comment'] : strip_tags(@$_POST['comment']),
     123    );
    125124     
    126125  if ($conf['activate_comments'])
     
    128127    $data['commentable'] = isset($_POST['commentable'])?$_POST['commentable']:'false';
    129128  }
    130 
    131   mass_updates(
     129 
     130  single_update(
    132131    CATEGORIES_TABLE,
    133     array(
    134       'primary' => array('id'),
    135       'update' => array_diff(array_keys($data), array('id'))
    136       ),
    137     array($data)
     132    $data,
     133    array('id' => $data['id'])
    138134    );
    139135
Note: See TracChangeset for help on using the changeset viewer.