Changeset 11162


Ignore:
Timestamp:
06/01/11 00:23:06 (8 years ago)
Author:
plg
Message:

merge r11160 from branch 2.2 to trunk

bug 2310 fixed: conf_update_param() does not erase config.comment column
anymore, we only insert a new row if the param does not exist yet in the
table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r9820 r11162  
    10231023{ 
    10241024  $query = ' 
    1025 DELETE 
     1025SELECT 
     1026    param, 
     1027    value 
    10261028  FROM '.CONFIG_TABLE.' 
    10271029  WHERE param = \''.$param.'\' 
    10281030;'; 
    1029   pwg_query($query); 
    1030  
    1031   $query = ' 
     1031  $params = array_from_query($query, 'param'); 
     1032 
     1033  if (count($params) == 0) 
     1034  { 
     1035    $query = ' 
    10321036INSERT 
    10331037  INTO '.CONFIG_TABLE.' 
     
    10351039  VALUES(\''.$param.'\', \''.$value.'\') 
    10361040;'; 
    1037   pwg_query($query); 
     1041    pwg_query($query); 
     1042  } 
     1043  else 
     1044  { 
     1045    $query = ' 
     1046UPDATE '.CONFIG_TABLE.' 
     1047  SET value = \''.$value.'\' 
     1048  WHERE param = \''.$param.'\' 
     1049;'; 
     1050    pwg_query($query); 
     1051  } 
    10381052} 
    10391053 
Note: See TracChangeset for help on using the changeset viewer.