-
mysql and mysqli connect
This may seem extremely weird; however, i have a problem with mysql_connect and mysqli_connect
PHP Code:
$host = "localhost";
$username = "";
$password = "";
$database = "bcelements";
//Dies
$con = mysqli_connect($host,$username,$password, $database) or die("Couldnt Connect to MYSQL!");
//Doesn't die
$con = mysql_connect($host,$username,$password, $database) or die("Couldnt Connect to MYSQL!");
$con = mysqli_connect($host,$username,$password);
If i use
PHP Code:
$con = mysqli_connect($host,$username,$password); //or $con = mysql_connect($host,$username,$password);
$selected = mysql_select_db($database, $con) or die("Crap you died"); //Dies
It still dies. Anyone have an idea of the problem?
-
Well I fixed the errors. Just letting everyone know this for their personal information:
localhost on php
PHP Code:
$host = "127.0.0.1";
$username = "root";
$password = "";
$database = "bcelements";
$con = mysqli_connect($host,$username,$password, $database) or die("Couldnt Connect to MYSQL!");