1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 21:58:10 +02:00

- added mysql_info support

This commit is contained in:
David Grudl
2009-02-22 20:03:09 +00:00
parent b958e37fdf
commit 60559d9a9f
2 changed files with 32 additions and 0 deletions

View File

@@ -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

View File

@@ -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