hello my friends
i have big problem
i want to install CMS the user enter the database by form like MyBB installation but i can't control the php error for test:
Warning: mysqli::mysqli() [mysqli.mysqli]: (28000/1045): Access denied for user 'exm2_tmu'@'localhost' (using password: YES) in /home/exm2/public_html/bs/Install/Install2.php on line 31
Can't connect To database please enter valid data
my code is :
$host = trim($_POST[hostname]);
$user = trim($_POST[dbuser]);
$pass = trim($_POST[dbpass]);
$db = trim($_POST[dbnname]);
$mysqli = new mysqli($host,$user,$pass,$db);
if (mysqli_connect_errno())
{
echo 'Can\'t connect To database please enter valid data
<meta http-equiv="Refresh" content="5;URL=./Install1.php">';
}
or this sample :
try {
$isCon = mysqli_connect($host,$user,$pass,$db);
}catch(exception $e)
{
echo 'Can\'t connect To database please enter valid data
<meta http-equiv="Refresh" content="2;URL=./Install1.php">';
}
or this sample:
$isCon = mysqli_connect($host,$user,$pass,$db)
or die (mysqli_error($isCon));
i know the user user name is invalid but i want test the user form data
how i can destroy this error ?