/** * 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); } }
/** * 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); } } }
/** * 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; }