예제 #1
0
 /**
  * Gets the max value of a specific column.
  * 
  * @param	string		$tableName
  * @param	string		$columnName
  * @return	integer
  */
 protected function __getMaxID($tableName, $columnName)
 {
     $sql = "SELECT\tMAX(" . $columnName . ") AS maxID\n\t\t\tFROM\t" . $tableName;
     $statement = $this->database->prepareStatement($sql);
     $statement->execute();
     $row = $statement->fetchArray();
     if ($row !== false) {
         return $row['maxID'];
     }
     return 0;
 }
예제 #2
0
 /**
  * @see	wcf\system\database\Database::prepareStatement()
  */
 public function prepareStatement($statement, $limit = 0, $offset = 0)
 {
     $statement = self::fixQuery($statement);
     return parent::prepareStatement($statement, $limit, $offset);
 }