コード例 #1
0
 /**
  * Executes SQL query.
  *
  * @param bool $debug Debug mode flag.
  *
  * @return mixed Statement object or FALSE if an error occurred if SELECT
  *           query executed or number of affected rows on success if other
  *           type of query executed.
  */
 public function go($debug = false)
 {
     if ($debug) {
         $this->debug();
     } else {
         if ($this->isSelector()) {
             return DBCore::doSelectQuery($this);
         }
         return DBCore::doUpdateQuery($this);
     }
 }
コード例 #2
0
ファイル: DBPreparedQuery.php プロジェクト: pomed/Framework
 /**
  * Executes SQL query.
  *
  * @param boolean $debug Debug mode flag.
  *
  * @return mixed Statement object or FALSE if an error occurred if SELECT
  *           query executed or number of affected rows on success if other
  *           type of query executed.
  */
 public function go($debug = false)
 {
     if ($debug) {
         DBQuery::showQueryDebugInfo($this->query, $this->types, $this->params);
     } else {
         if ($this->isSelect()) {
             return DBCore::doSelectQuery($this);
         } else {
             return DBCore::doUpdateQuery($this);
         }
     }
 }
コード例 #3
0
ファイル: DBCore.php プロジェクト: pomed/Framework
 /**
  * Selects DBObject list from database.
  *
  * @param string $query SQL query.
  * @param string $types Types string (ex: "isdb").
  * @param array $params Parameters in the same order like types string.
  * @param mixed $instance Instance of the some DBObject class or it's class name.
  *
  * @return DBObject Selected DBObject or NULL otherwise.
  */
 public static function selectDBObjects($query, $types, $params, $instance)
 {
     $stmt = DBCore::doSelectQuery($query, $types, $params);
     $obj = null;
     if ($stmt) {
         $obj = DBCore::selectDBObjectsFromStatement($stmt, $instance);
         $stmt->close();
     }
     return $obj;
 }