-1
PHP 5.3用に作成されたPHPコードがあります。PHP 5.6で使用する必要があるので、コードをmysql_からmyspli_に変換する必要があります。助けてください。 database.phpでmysql_からmysqli_へのPHPコードの移行
<?php
$db_host = "localhost";
$db_username = "usr12345";
$db_password = "pass12345";
$database = "db12345";
?>
PHPのコンテンツの
内容は
// If database.php does not exist then print error
if (!include("database.php")) die("database.php could not be loaded!");
if ($db_host == "" || !isset($db_host)) die("please reinstall this panel");
//MySQL Verbindung wird getestet
$connection = mysql_connect($db_host, $db_username, $db_password) or die ("database could not be connected");
$db = mysql_select_db($database) or die ("database could not be selected");
// Logincheck
session_start();
// Language File check on DB
$captcha_sql = mysql_query("SELECT language FROM settings WHERE id='0'");
$language_setting = mysql_result($captcha_sql,0);
// Check if Language-file exists and include, else load English
if (file_exists("./pages/messages/".$language_setting.".php")) {
$language_setting = $language_setting;
}
else {
$errors[] = "<h2>The language file could not be found, English is the default language!</h2>";
$language_setting = "english";
}
include "./pages/messages/".$language_setting.".php";
// Get variable for include
if (!isset($_GET['include'])) {
$include_php = "main";
}
else {
$include_php = $_GET['include'];
}
私がオフトピックとして、この質問を閉じるために投票しています。このため、コード変換要求です。 – chris85