mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 05:37:39 +02:00
- added mysql_info support
This commit is contained in:
@@ -178,6 +178,22 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves information about the most recently executed query.
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getInfo()
|
||||||
|
{
|
||||||
|
$res = array();
|
||||||
|
preg_match_all('#(.+?): +(\d+) *#', mysql_info($this->connection), $matches, PREG_SET_ORDER);
|
||||||
|
foreach ($matches as $m) {
|
||||||
|
$res[$m[1]] = (int) $m[2];
|
||||||
|
}
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
|
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
|
||||||
* @return int|FALSE number of rows or FALSE on error
|
* @return int|FALSE number of rows or FALSE on error
|
||||||
|
@@ -162,6 +162,22 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves information about the most recently executed query.
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getInfo()
|
||||||
|
{
|
||||||
|
$res = array();
|
||||||
|
preg_match_all('#(.+?): +(\d+) *#', mysqli_info($this->connection), $matches, PREG_SET_ORDER);
|
||||||
|
foreach ($matches as $m) {
|
||||||
|
$res[$m[1]] = (int) $m[2];
|
||||||
|
}
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
|
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
|
||||||
* @return int|FALSE number of rows or FALSE on error
|
* @return int|FALSE number of rows or FALSE on error
|
||||||
|
Reference in New Issue
Block a user