v5:database:mysql
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
database:mysql [2015/10/31 23:54] – [renameColumnSql] mnewnham | v5:database:mysql [2024/04/30 13:07] (current) – Forcing emulated prepared statements dregad | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== MySQL ===== | ====== MySQL ===== | ||
- | Read the [[userguide: | + | ~~NOTOC~~ |
- | ====== mysqli driver | + | ===== mysqli driver ===== |
- | < | + | |
- | ** This is the preferred driver to connections to MySQL databases. ** | + | < |
- | |Driver Name|mysqli| | + | |
- | |Status|Active| | + | == Specification == |
- | |Windows|Yes| | + | ^Driver Name|mysqli| |
- | |Unix|Yes| | + | ^Data Provider|[[v5: |
+ | ^Status|Active((This driver is actively supported by ADOdb project members))| | ||
+ | ^Windows|Yes| | ||
+ | ^Unix|Yes| | ||
+ | ^ADOdb V5|Yes| | ||
+ | ^ADOdb V6|Yes| | ||
+ | |||
+ | == Alternatives == | ||
+ | [[v5: | ||
+ | |||
+ | == See Also == | ||
+ | [[v5: | ||
</ | </ | ||
- | 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. | ||
- | ---------------------------------------------- | + | ** This is the preferred driver for connections to the following databases: |
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
- | ====== mysql driver | + | This driver |
- | <WRAP left 300px box> | + | |
- | |Driver Name|mysql| | + | It replaces [[v5: |
- | |Status|Deprecated| | + | |
- | |Windows|Yes| | + | < |
- | |Unix|Yes| | + | Starting with ADOdb 5.22, the mysqli |
- | </WRAP> | + | |
- | This driver uses the PHP original mysql driver | + | |
- | -------------------------------------------- | + | |
- | ====== mysqlt driver ====== | + | |
- | <WRAP left 300px box> | + | |
- | |Driver | + | |
- | |Status|Deprecated| | + | |
- | |Windows|Yes| | + | |
- | |Unix|Yes| | + | |
</ | </ | ||
- | This driver uses the PHP original mysql driver and provided support to transactional tables such as InnoDB. It cannot be used with the PHP ' | + | |
- | -------------------------------- | + | |
- | ====== mysqlpo driver ====== | + | ------------------------------------------- |
- | <WRAP left 300px box> | + | |
- | |Driver Name|mysqlpo| | + | |
- | |Status|Obsolete| | + | |
- | |Windows|Yes| | + | |
- | |Unix|Yes| | + | |
- | </ | + | |
- | 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: | + | The method [[v5:dictionary:renamecolumnsql|renameColumnSql]] normally takes 3 parameters, '' |
'' | '' | ||
- | === Usage === | + | ==== Usage ==== |
<code php> | <code php> | ||
/* | /* | ||
Line 55: | Line 52: | ||
$sql = $dict-> | $sql = $dict-> | ||
- | </ | + | </ |
- | {{tag> | + | ==== 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(' | ||
+ | /* | ||
+ | * Set the SSL parameters | ||
+ | */ | ||
+ | $db-> | ||
+ | $db-> | ||
+ | $db-> | ||
+ | $db-> | ||
+ | $db-> | ||
+ | |||
+ | /* | ||
+ | * Open the connection | ||
+ | */ | ||
+ | $db-> | ||
+ | </ | ||
+ | |||
+ | ==== Connecting To A Microsoft Azure MySQL Instance ==== | ||
+ | <code php> | ||
+ | /* | ||
+ | * Enable ADOdb | ||
+ | */ | ||
+ | $db = newAdoConnection(' | ||
+ | |||
+ | $database = ' | ||
+ | $host = ' | ||
+ | $user = ' | ||
+ | $password = ' | ||
+ | |||
+ | $db-> | ||
+ | |||
+ | /* | ||
+ | * Open the connection | ||
+ | */ | ||
+ | $db-> | ||
+ | </ | ||
+ | |||
+ | ==== Forcing emulated prepared statements ==== | ||
+ | |||
+ | ADOdb 5.22 introduced support for " | ||
+ | [[https:// | ||
+ | see [[https:// | ||
+ | Before that, parameterized queries were emulated, which was a potential security risk. | ||
+ | |||
+ | When using database engines pretending to be MySQL but not implementing prepared statements such as | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | it is possible((starting with ADOdb 5.22.8)) to force usage of emulated queries (i.e. reverting to behavior of ADOdb 5.21 and older) by setting the '' | ||
+ | |||
+ | <code php> | ||
+ | $db = newAdoConnection(' | ||
+ | $db-> | ||
+ | $db-> | ||
+ | $db-> | ||
+ | </ | ||
+ | |||
+ | {{tag> | ||
+ | {{htmlmetatags> |
v5/database/mysql.txt · Last modified: 2024/04/30 13:07 by dregad