MySQLi connection on die redirect to website
Hi there, how would I modify the connection script so that on a connect error it redirects to a website, I've tried the script below but it's not working, any help would be much appreciated, thanks.
<?php
# FileName="WADYN_MYSQLI_CONN.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_securex = "localhost";
$database_securex = "database";
$username_securex = "account";
$password_securex = "password";
@session_start();
$securex = mysqli_init();
if (defined("MYSQLI_OPT_INT_AND_FLOAT_NATIVE")) $securex->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, TRUE);
$securex->real_connect($hostname_securex, $username_securex, $password_securex, $database_securex) or die(header("Location: https://lm-activate.nexuscst.com/?na=1"));
?>