1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-28 00:29:59 +02:00

Display error code in SQL query

This commit is contained in:
Jakub Vrana
2013-01-09 22:19:38 -08:00
parent 588cb7c0c3
commit a9262d8752
7 changed files with 12 additions and 7 deletions

View File

@@ -54,6 +54,7 @@ if (!defined("DRIVER")) {
$extension = "MySQL", ///< @var string extension name
$server_info, ///< @var string server version
$affected_rows, ///< @var int number of affected rows
$errno, ///< @var int last error code
$error, ///< @var string last error message
$_link, $_result ///< @access private
;
@@ -110,6 +111,7 @@ if (!defined("DRIVER")) {
$result = @($unbuffered ? mysql_unbuffered_query($query, $this->_link) : mysql_query($query, $this->_link)); // @ - mute mysql.trace_mode
$this->error = "";
if (!$result) {
$this->errrno = mysql_errno($this->_link);
$this->error = mysql_error($this->_link);
return false;
}