I am using a function that is supposed to get the result row as an associative array but it does not get me because it changes from mysql to mysqli according to the moderator's instructions.
What am I doing wrong
function dbquery($link,$query) {
$result = mysqli_query($link, $query );
if (!$result) {
echo mysqli_connect_error();
return false;
} else {
return($result);
}
mysqli_close($link);
}
Function to connect to the database
function dbconnect($db_host, $db_user, $db_pass, $db_name) {
global $db_connect;
$db_connect = mysqli_connect($db_host, $db_user, $db_pass);
$db_select = mysqli_select_db($db_connect, $db_name);
if (!$db_connect) {
die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Unable to establish connection to MySQL</b><br />".mysqli_connect_error()." : ".mysqli_connect_error()."</div>");
} elseif (!$db_select) {
die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Unable to select MySQL database</b><br />".mysqli_connect_error($db_name)." : ".mysqli_connect_error()."</div>");
}
}
$link = dbconnect($db_host, $db_user, $db_pass, $db_name);
What is wrong ??
Notice: Undefined index: siteurl in /home/sfera/public_html/locale/Polish-utf8/global.php on line 132
Notice: Undefined index: siteurl in /home/sfera/public_html/locale/Polish-utf8/global.php on line 140
Notice: Undefined index: siteurl in /home/sfera/public_html/locale/Polish-utf8/global.php on line 147
You know how to remove this error the error is from the locale. I will show you that you know what's going on
$locale['global_441'] = "Your account on ".$settings['sitename']."has been banned";
$locale['global_442'] = "Hello [USER_NAME],
Your account on ".$settings['sitename']." was caught posting too many items to the system in very short time from the IP ".USER_IP.", and have therefor been banned. This is done to prevent bots from submitting spam messages in rapid succession.
Please contact the site administrator at ".$settings['siteemail']." to have your account restored or report if this was not you causing this security ban.
".$settings['siteusername'];
// Lifting of suspension
$locale['global_450'] = "Suspension automatically lifted by system";
$locale['global_451'] = "Suspension lifted at ".$settings['sitename'];
$locale['global_452'] = "Hello USER_NAME,
The suspension of your account at ".$settings['siteurl']." has been lifted. Here are your login details:
Username: USER_NAME
Password: Hidden for security reasons
If you have forgot your password you can reset it via the following link: LOST_PASSWORD
Regards,
".$settings['siteusername'];
$locale['global_453'] = "Hello USER_NAME,
The suspension of your account at ".$settings['siteurl']." has been lifted.
Regards,
".$settings['siteusername'];
$locale['global_454'] = "Account reactivated at ".$settings['sitename'];
$locale['global_455'] = "Hello USER_NAME,
Last time you logged in your account was reactivated at ".$settings['siteurl']." and your account is no longer marked as inactive.
Regards,
It makes me an argument from the base though I have it in function
// Fetch the Site Settings from the database and store them in the $settings variable
$settings = dbarray(dbquery($link,"SELECT * FROM ".$db_prefix."setting"));
So this is but the locale do not want to read them