diff --git a/inc/main.php b/inc/main.php index 8daaaa9..4e59d3f 100755 --- a/inc/main.php +++ b/inc/main.php @@ -15,6 +15,9 @@ abstract class Main extends PhpObject const NO_DATA = 'No Data'; //... + const ACTIVE = 1; + const INACTIVE = 0; + //Folders const MASKS_FOLDER = 'masks/'; diff --git a/inc/mysqlmanager.php b/inc/mysqlmanager.php index bf28c1f..7ea1d48 100755 --- a/inc/mysqlmanager.php +++ b/inc/mysqlmanager.php @@ -350,20 +350,15 @@ class MySqlManager extends PhpObject $this->addColumnSelectors($asConstraintsValues); $sLimit = $iLimit>0?" LIMIT $iLimit":""; - $sQuery = "UPDATE {$sTableName} ". - "SET ".$this->implodeAll($asQueryValues, " = ", ", ")." ". - "WHERE ".$this->implodeAll($asConstraintsValues, " = ", " AND ").$sLimit; + $sQuery = "UPDATE {$sTableName} ". + "SET ".$this->implodeAll($asQueryValues, " = ", ", ")." ". + "WHERE ".$this->implodeAll($asConstraintsValues, " = ", " AND ").$sLimit; $iResult = false; - if($this->setQuery($sQuery)) - { - $this->setTrace(true); - if($iLimit==1) - { - $iResult = array_key_exists($sTableIdCol, $asConstraints)?$asConstraints[$sTableIdCol]:$this->selectValue($sTableName, $sTableIdCol, $asConstraints); - } - else $iResult = true; - } + if($this->setQuery($sQuery) && $iLimit!=1) $iResult = true; + else $iResult = array_key_exists($sTableIdCol, $asConstraints)?$asConstraints[$sTableIdCol]:$this->selectValue($sTableName, $sTableIdCol, $asConstraints); + + $this->addError($iResult); return $iResult; } diff --git a/inc/toolbox.php b/inc/toolbox.php index 1e7fab2..8dc541c 100755 --- a/inc/toolbox.php +++ b/inc/toolbox.php @@ -380,7 +380,7 @@ class ToolBox * @param String $string * @return String */ - public function remove_accents($string) + public static function remove_accents($string) { if(!preg_match('/[\x80-\xff]/', $string)) return $string;