芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/kwesioben.com/store/system/library/db/mysqli.php
connect_errno) { $this->connection = $mysqli; $this->connection->report_mode = MYSQLI_REPORT_ERROR; $this->connection->set_charset('utf8'); $this->connection->query("SET SESSION sql_mode = 'NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION'"); } else { throw new \Exception('Error: Could not make a database link using ' . $username . '@' . $hostname . '!'); } } public function query($sql) { $query = $this->connection->query($sql); if (!$this->connection->errno) { if ($query instanceof \mysqli_result) { $data = []; while ($row = $query->fetch_assoc()) { $data[] = $row; } $result = new \stdClass(); $result->num_rows = $query->num_rows; $result->row = isset($data[0]) ? $data[0] : []; $result->rows = $data; $query->close(); unset($data); return $result; } else { return true; } } else { throw new \Exception('Error: ' . $this->connection->error . '
Error No: ' . $this->connection->errno . '
' . $sql); } } public function escape($value) { return $this->connection->real_escape_string($value); } public function countAffected() { return $this->connection->affected_rows; } public function getLastId() { return $this->connection->insert_id; } public function isConnected() { if ($this->connection) { return $this->connection->ping(); } else { return false; } } /** * __destruct * * Closes the DB connection when this object is destroyed. * */ public function __destruct() { if ($this->connection) { $this->connection->close(); $this->connection = ''; } } }