feature 65: fetch_assoc behaves different with mysql and mysqli. When no row

is returned, mysql returns bool:false, while mysqli returns null and it was
breaking completely the installation process. I have faked the old mysql
behavior with mysqli (just for get_default_user_infos function)


git-svn-id: http://piwigo.org/svn/trunk@20545 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall 2013-02-04 13:04:42 +00:00
parent b267aea0e2
commit 4c4bf26b0c

View file

@ -808,18 +808,26 @@ function get_default_user_info($convert_str = true)
if (!isset($cache['default_user']))
{
$query = 'SELECT * FROM '.USER_INFOS_TABLE.
' WHERE user_id = '.$conf['default_user_id'].';';
$query = '
SELECT *
FROM '.USER_INFOS_TABLE.'
WHERE user_id = '.$conf['default_user_id'].'
;';
$result = pwg_query($query);
$cache['default_user'] = pwg_db_fetch_assoc($result);
if ($cache['default_user'] !== false)
if (pwg_db_num_rows($result) > 0)
{
$cache['default_user'] = pwg_db_fetch_assoc($result);
unset($cache['default_user']['user_id']);
unset($cache['default_user']['status']);
unset($cache['default_user']['registration_date']);
}
else
{
$cache['default_user'] = false;
}
}
if (is_array($cache['default_user']) and $convert_str)