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