I’m using Joomla 1.5 and want to make custom pagination. For that I need to connect to the DB.
database_connection.php:
<?php
/*Define constant to connect to database */
DEFINE('DATABASE_USER', 'padekime_db'); //this is my user's name
DEFINE('DATABASE_PASSWORD', 'myPassword');
DEFINE('DATABASE_HOST', 'hostingas.in');
DEFINE('DATABASE_NAME', 'padekime_db');
// Make the connection:
$dbc = @mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD,
DATABASE_NAME);
if (!$dbc) {
trigger_error('Could not connect to MySQL: ' . mysqli_connect_error());
}
?>
This is error that I receive:
Notice: Could not connect to MySQL: Access denied for user 'padekime_db'@'neva.hostingas.in' (using password: YES) in /home/padekime/domains/juokoera.lt/public_html/components/com_allvideoshare/views/videos/tmpl/database_connection.php on line 16
What can be wrong?
Ah. The server is most likely declining remote hosts from accessing. If they are on the same server, put localhost for your host. Also, that host might not be the host that serves your MySQL database. Hope this helps!