Fatal error : Uncaught Error: Call to undefined function mysql_select_db() in /storage/ssd3/346/11352346/public_html/secretary/dbconnect.php:13 Stack trace: #0 /storage/ssd3/346/11352346/public_html/secretary/index.php(5): require_once() #1 {main} thrown in /storage/ssd3/346/11352346/public_html/secretary/dbconnect.php on line 13
<?php
error_reporting(E_ALL);
define('DBHOST', 'localhost');
define('DBUSER', 'id000001_username');
define('DBPASS', '*********************');
define('DBNAME', 'id000001_dbname');
$conn = mysqli_connect(DBHOST,DBUSER,DBPASS); // i have this error
$dbcon = mysql_select_db(DBNAME);
if ( !$conn ) {
die("Connection failed : " . mysql_error());
}
if ( !$dbcon ) {
die("Database Connection failed : " . mysql_error());
}
?>
PDO would be best
This topic was automatically closed after 3 hours. New replies are no longer allowed.