summaryrefslogtreecommitdiff
path: root/drivers/adodb-mysql.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/adodb-mysql.inc.php')
-rw-r--r--drivers/adodb-mysql.inc.php39
1 files changed, 26 insertions, 13 deletions
diff --git a/drivers/adodb-mysql.inc.php b/drivers/adodb-mysql.inc.php
index 732acff6..cd7e4998 100644
--- a/drivers/adodb-mysql.inc.php
+++ b/drivers/adodb-mysql.inc.php
@@ -1,6 +1,6 @@
<?php
/*
-@version v5.20.10 08-Mar-2018
+@version v5.21.0-dev ??-???-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
@@ -12,7 +12,7 @@
is deprected in PHP version 5.5 and removed in PHP version 7. It is deprecated
as of ADOdb version 5.20.0. Use the mysqli driver instead, which supports both
transactional and non-transactional updates
-
+
Requires mysql client. Works on Windows and Unix.
28 Feb 2001: MetaColumns bug fix - suggested by Freek Dijkstra (phpeverywhere@macfreek.com)
@@ -51,12 +51,31 @@ class ADODB_mysql extends ADOConnection {
var $nameQuote = '`'; /// string to use to quote identifiers and names
var $compat323 = false; // true if compat with mysql 3.23
- function __construct()
- {
- if (defined('ADODB_EXTENSION')) $this->rsPrefix .= 'ext_';
+ /**
+ * ADODB_mysql constructor.
+ */
+ public function __construct() {
+ if(version_compare(PHP_VERSION, '7.0.0', '>=')) {
+ $this->outp_throw(
+ 'mysql extension is not supported since PHP 7.0.0, use mysqli instead',
+ __METHOD__
+ );
+ die(1); // Stop execution even if not using Exceptions
+ } elseif(version_compare(PHP_VERSION, '5.5.0', '>=')) {
+ // If mysql extension is available just print a warning,
+ // otherwise die with an error message
+ if(function_exists('mysql_connect')) {
+ $this->outp('mysql extension is deprecated since PHP 5.5.0, consider using mysqli');
+ } else {
+ $this->outp_throw(
+ 'mysql extension is not available, use mysqli instead',
+ __METHOD__
+ );
+ die(1); // Stop execution even if not using Exceptions
+ }
+ }
}
-
// SetCharSet - switch the client encoding
function SetCharSet($charset_name)
{
@@ -796,8 +815,6 @@ class ADORecordSet_mysql extends ADORecordSet{
function MoveNext()
{
- //return adodb_movenext($this);
- //if (defined('ADODB_EXTENSION')) return adodb_movenext($this);
if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) {
$this->_updatefields();
$this->_currentRow += 1;
@@ -872,17 +889,13 @@ class ADORecordSet_mysql extends ADORecordSet{
if (!empty($fieldobj->primary_key)) return 'R';
else return 'I';
- default: return 'N';
+ default: return ADODB_DEFAULT_METATYPE;
}
}
}
class ADORecordSet_ext_mysql extends ADORecordSet_mysql {
- function __construct($queryID,$mode=false)
- {
- parent::__construct($queryID,$mode);
- }
function MoveNext()
{