Convert Mysql to Mysqli?

Hi, Could someone help me convert this code from Mysql to Mysqli, thankyou!!


$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_name = '';
$db_connect = mysql_connect($db_host, $db_user, $db_pass);

$site_settings = mysql_fetch_array(mysql_query("SELECT * FROM site_settings"));
$i["url"] = $site_settings["url"];
$i["logourl"] = $site_settings["logourl"];
$i["title"] = $site_settings["title"];
$i["slogan"] = $site_settings["slogan"];
$i["footer"] = $site_settings["footer"];
$i["title_text1"] = $site_settings["title_text1"];
$i["title_text2"] = $site_settings["title_text2"];

// Maintience - Either yes or no
$sitemaintainance = "no";

if($sitemaintainance == 'yes'){ header("Location: downtime.php"); }


and so that I include the above codes ^^ from my config file, I can use <?php echo $i[“title”]; ?> to make my title show.

This article explains about converting from the mysql_* extension over to PDO. PDO is a better choice then the mysqli_* extension as all the function calls are the same irrespective of what database server is being used. The only difference is the establishment of the connection to the database server and any syntax specific to a certain server software that you might use.