On four pages, a query runs to extract db information. This displays correctly. On this page, one should be able to click on a name or photo and then another query is run and a new page is opened displaying the results from another query. However, I get the following message when I make the appropriate click:
Code: Select all
Access denied for user 'user'@'localhost' to database 'databasename'The php access include file is:
Code: Select all
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_dbConnect = "localhost";
$database_dbConnect = "databasename";
$username_dbConnect = "user";
$password_dbConnect = "password";
$dbConnect = mysql_connect ($hostname_dbConnect, $username_dbConnect, $password_dbConnect) or trigger_error(mysql_error(),E_USER_ERROR);
?>Code: Select all
<?php require_once('dbconnect.php');
mysql_select_db($database_dbConnect, $dbConnect);As I said, the site had worked fine. I then uploaded some files which worked ok locally (but needed tweaking 'live'), and on the same day the host server 'had problems' with php file security. I assume that this problem is of my making, but as I know that other sites on this server had php pages hacked, I'm not sure that the files that I uploaded are the cause. I have now changed hosting company.
I'd be grateful if somebody could point me in the right direction as I've spent many hours seaching forums and manuals but can't get to the bottom of it, and would like to know how access rights can be fine for one page but not another.