Ignore:
Timestamp:
Nov 25, 2009, 8:02:57 PM (14 years ago)
Author:
nikrou
Message:

Feature 1255: modification in sql queries

  • manage random function
  • manage regex syntax
  • manage quote (single instead of double)
  • manage interval
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/site_update.php

    r4325 r4367  
    149149    {
    150150      $query.= '
    151     AND uppercats REGEXP \'(^|,)'.$_POST['cat'].'(,|$)\'
     151    AND uppercats '.DB_REGEX_OPERATOR.' \'(^|,)'.$_POST['cat'].'(,|$)\'
    152152';
    153153    }
     
    208208
    209209  // next category id available
    210   $query = '
    211 SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_id
    212   FROM '.CATEGORIES_TABLE;
    213   list($next_id) = pwg_db_fetch_row(pwg_query($query));
     210  $next_id = pwg_db_nextval('id', CATEGORIES_TABLE);
    214211
    215212  // retrieve sub-directories fulldirs from the site reader
     
    400397
    401398  // next element id available
    402   $query = '
    403 SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
    404   FROM '.IMAGES_TABLE;
    405   list($next_element_id) = pwg_db_fetch_row(pwg_query($query));
     399  $next_element_id = pwg_db_nextval('id', IMAGES_TABLE);
    406400
    407401  $start = get_moment();
Note: See TracChangeset for help on using the changeset viewer.