Пример #1
0
 function execute($query)
 {
     if (!$this->isConnected()) {
         $this->connect($this->database);
     }
     Connection::startMeasuring($this);
     if (func_num_args() > 1) {
         $query = call_user_func_array('sprintf', func_get_args());
     }
     $result = mysql_query($query, $this->connection);
     Connection::endMeasuring($this);
     if (!$result) {
         throw new QueryException(mysql_error($this->connection), mysql_errno($this->connection));
     }
     return new RecordSet($result);
 }