ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:database:mysql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
database:mysql [2015/11/26 21:51] mnewnhamv5:database:mysql [2023/05/10 09:41] (current) – [mysqli driver] mysqlnd required since 5.22 dregad
Line 1: Line 1:
 ====== MySQL ===== ====== MySQL =====
 ~~NOTOC~~ ~~NOTOC~~
-<WRAP right box round> 
-See Also: [[database:pdo#pdo_mysql|PDO driver for MySQL]] 
-</WRAP> 
 ===== mysqli driver ===== ===== mysqli driver =====
-<WRAP left 300px box> + 
-** This is the preferred driver to connections to MySQL databases. ** +<WRAP right box round 300px
-|Driver Name|mysqli| + 
-|Status|Active| +== Specification == 
-|Windows|Yes| +^Driver Name|mysqli| 
-|Unix|Yes|+^Data Provider|[[v5:userguide:learn_extensions:new_driver#Understanding The Data Provider|mysql]]| 
 +^Status|Active((This driver is actively supported by ADOdb project members))
 +^Windows|Yes| 
 +^Unix|Yes| 
 +^ADOdb V5|Yes| 
 +^ADOdb V6|Yes| 
 + 
 +== Alternatives == 
 +[[v5:database:pdo#pdo_mysql|PDO driver for MySQL]] 
 + 
 +== See Also == 
 +[[v5:reference:connection:setconnectionparameter#mysql|setConnectionParameter()]]
 </WRAP> </WRAP>
-This preferred driver uses the PHP mysqli interface and supports all MySQL table types, with full support for transactions and rollback when the MySQL table type supports it.   
  
-===== Support Status ===== +** This is the preferred driver for connections to the following databases:** 
-This driver is actively supported by ADOdb project members+  * [[http://mysql.com|MySQL]] 
 +  * [[http://mariadb.com|MariaDB]] 
 +  * [[http://percona.com|Percona]]
  
-----------------------------------------------+This driver uses the PHP **mysqli** interface and supports all table types, with full support for transactions and rollback when the table type supports it. 
  
-===== mysql driver ===== +It replaces [[v5:database:mysql_legacy|]] (**mysql**, **mysqlt** and **mysqlpo**). 
-<WRAP left 300px box> + 
-|Driver Name|mysql| +<WRAP important
-|Status|Deprecated| +Starting with ADOdb 5.22, the mysqli driver requires the [[https://www.php.net/manual/en/book.mysqlnd.php|MySQL Native Driver (Mysqlnd)]]
-|Windows|Yes| +
-|Unix|Yes| +
-</WRAP> +
-This driver uses the PHP original mysql driver and only provides support to non-transactional tables such as MyIsam. It cannot be used with the PHP 'Improved' MySQL driver. The PHP driver is deprecated as of PHP Version 5.5 and will be removed in PHP version 7. This driver is deprecated as of ADOdb version 5.20 and will be removed in ADOdb version 6.0 +
--------------------------------------------- +
-===== mysqlt driver ===== +
-<WRAP left 300px box> +
-|Driver Name|mysqlt| +
-|Status|Deprecated| +
-|Windows|Yes| +
-|Unix|Yes| +
-</WRAP> +
-This driver uses the PHP original mysql driver and provided support to transactional tables such as InnoDB. It cannot be used with the PHP 'improved' MySQL driverThe PHP driver is deprecated as of PHP Version 5.5 and will be removed in PHP version 7This driver is deprecated as of ADOdb version 5.20 and will be removed in ADOdb version 6.0 +
--------------------------------- +
-===== mysqlpo driver ===== +
-<WRAP left 300px box> +
-|Driver Name|mysqlpo| +
-|Status|Obsolete| +
-|Windows|Yes| +
-|Unix|Yes|+
 </WRAP> </WRAP>
-This driver duplicates the functionality of the mysqlt driver and is not maintained. It will be removed in ADOdb version 6.0+ 
 + 
 +-------------------------------------------
  
 ===== Driver Specific Issues ===== ===== Driver Specific Issues =====
 ==== renameColumnSql ==== ==== renameColumnSql ====
-The method [[dictionary:renameColumnSql|renameColumnSql]] normally takes 3 parameters, ''$tableName'',+The method [[v5:dictionary:renamecolumnsql|renameColumnSql]] normally takes 3 parameters, ''$tableName'',
 ''$oldColumnName'' and ''$newColumnName''. When used with the mysql provider, a full definition of the column must be provided, as if creating the column new ''$oldColumnName'' and ''$newColumnName''. When used with the mysql provider, a full definition of the column must be provided, as if creating the column new
 ==== Usage ==== ==== Usage ====
Line 61: Line 52:
  
 $sql = $dict->renameColumnSql($table,'col9','col6', $flds); $sql = $dict->renameColumnSql($table,'col9','col6', $flds);
-</code>  +</code> 
-{{tag>[MySQL windows unix supported]}}+==== Connecting With SSL ==== 
 +From ADOdb version 5.21, you can make an SSL connection to MySQL in the following way: 
 + 
 +<code php> 
 +/* 
 +* Enable ADOdb 
 +*/ 
 +$db = newAdoConnection('mysqli'
 +/* 
 +* Set the SSL parameters 
 +*/ 
 +$db->ssl_key    = "key.pem"; 
 +$db->ssl_cert   = "cert.pem";  
 +$db->ssl_ca     = "cacert.pem"; 
 +$db->ssl_capath = null;  
 +$db->ssl_cipher = null;  
 + 
 +/* 
 +* Open the connection 
 +*/ 
 +$db->connect($host, $user, $password, $database); 
 +</code> 
 + 
 +==== Connecting To A Microsoft Azure MySQL Instance ==== 
 +<code php> 
 +/* 
 +* Enable ADOdb 
 +*/ 
 +$db = newAdoConnection('mysqli'
 + 
 +$database = 'employees'; 
 +$host     = 'my-corporation.mysql.database.azure.com'; 
 +$user     = 'corpuser'; 
 +$password = 'Qzrt6r55geRt!'; 
 + 
 +$db->ssl_ca     = '/opt/azure-cert/DigiCertGlobalRootCA.crt.pem'; 
 + 
 +/* 
 +* Open the connection 
 +*/ 
 +$db->connect($host, $user, $password, $database); 
 +</code> 
 + 
 +{{tag>[MySQL windows unix supported tier1]}} 
 +{{htmlmetatags>metatag-keywords=(php, programming, database, mysql, percona, mariadb)}}
v5/database/mysql.1448571109.txt.gz · Last modified: 2017/04/21 11:25 (external edit)