1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

Merge remote-tracking branch 'upstream/develop-ascraeus' into ticket/12594

Conflicts:
	phpBB/docs/hook_system.html
This commit is contained in:
Yuriy Rusko
2014-05-27 21:55:40 +02:00
39 changed files with 507 additions and 2465 deletions

View File

@@ -210,7 +210,26 @@ class mysql extends \phpbb\db\driver\mysql_base
*/
function sql_affectedrows()
{
return ($this->db_connect_id) ? @mysql_affected_rows($this->db_connect_id) : false;
if ($this->db_connect_id)
{
// We always want the number of matched rows
// instead of changed rows, when running an update.
// So when mysql_info() returns the number of matched rows
// we return that one instead of mysql_affected_rows()
$mysql_info = @mysql_info($this->db_connect_id);
if ($mysql_info !== false)
{
$match = array();
preg_match('#^Rows matched: (\d)+ Changed: (\d)+ Warnings: (\d)+$#', $mysql_info, $match);
if (isset($match[1]))
{
return $match[1];
}
}
return @mysql_affected_rows($this->db_connect_id);
}
return false;
}
/**

View File

@@ -60,7 +60,8 @@ class mysqli extends \phpbb\db\driver\mysql_base
}
}
$this->db_connect_id = @mysqli_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket);
$this->db_connect_id = mysqli_init();
@mysqli_real_connect($this->db_connect_id, $this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS);
if ($this->db_connect_id && $this->dbname != '')
{