1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Reset error before using in SQL query

This commit is contained in:
Jakub Vrana
2012-07-15 09:21:22 -07:00
parent 6a3cf71db5
commit 7291ae608d
6 changed files with 9 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function query($query) {
$result = @$this->_link->query($query);
$this->error = "";
if (!$result) {
$this->error = $this->_link->lastErrorMsg();
return false;
@@ -93,6 +94,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function query($query, $unbuffered = false) {
$method = ($unbuffered ? "unbufferedQuery" : "query");
$result = @$this->_link->$method($query, SQLITE_BOTH, $error);
$this->error = "";
if (!$result) {
$this->error = $error;
return false;