db_mysql::query PHP Method

query() public method

public query ( $sql, $link = NULL )
    public function query($sql, $link = NULL)
    {
        if (!$link) {
            if (!$this->rlink && !$this->connect_slave()) {
                return FALSE;
            }
            $link = $this->link = $this->rlink;
        }
        $query = mysql_query($sql, $link);
        if ($query === FALSE) {
            $this->error();
        }
        if (count($this->sqls) < 1000) {
            $this->sqls[] = $sql;
        }
        return $query;
    }

Usage Example

コード例 #1
0
 function query($sql, $type = '')
 {
     if ($this->slaveid && !$this->slaveexcept && strtoupper(substr($sql, 0, 6)) == 'SELECT') {
         $this->slave_connect();
     }
     $this->slaveexcept = false;
     return parent::query($sql, $type);
 }
All Usage Examples Of db_mysql::query