I have a script and when I go to the website link(http://kodle.co.uk/login.php) the script comes back with this:
Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using >password: NO) in /home/hkode/public_html/dbconnect.php on line 12
Warning: mysql_select_db(): Access denied for user 'hkode'@'localhost' (using >password: NO) in /home/hkode/public_html/dbconnect.php on line 13
Warning: mysql_select_db(): A link to the server could not be established in >/home/hkode/public_html/dbconnect.php on line 13 Connection failed : Access denied for user 'hkode'@'localhost' (using password: >NO)
The DBCONNECT.php script is as follows:
<?php
// this will avoid mysql_connect() deprecation error.
error_reporting( ~E_DEPRECATED & ~E_NOTICE );
// but I strongly suggest you to use PDO or MySQLi.
define('DBHOST', 'localhost');
define('DBUSER', 'root');
define('DBPASS', '');
define('DBNAME', 'login_base');
$conn = mysql_connect("localhost", "root", "");
$dbcon = mysql_select_db(DBNAME);
if ( !$conn ) {
die("Connection failed : " . mysql_error());
}
if ( !$dbcon ) {
die("Database Connection failed : " . mysql_error());
}