Hello to all, thanx for taKing the time to read this and to assist. I feel like this is going to be more than likely a very simple thing, but has eluded me thus far.
This code worked on my local development machine, but then I transferred it over to a FreeBSD machine, which I have just built and it does not function the same way.
The exact errors I get are:
Warning: mysql_query() [function.mysql-query]: Access denied for user 'murias'@'localhost' (using password: NO) in /usr/home/www/develop.develop/property/add_user.php on line 47
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /usr/home/www/develop.develop/property/add_user.php on line 47
Code from the script lines 2 and 42 through 47:
include_once ('mysql.inc.php') ;
$query = "INSERT INTO users VALUES('', '".$_POST["user"]."', "
."PASSWORD('".$_POST["password"]."'),"
."'".$_POST["email"]."',"
."'".$_POST["management"]."', "
."'".$_POST["permission"]."', '', '', '')" ;
$result = mysql_query($query);
Code from mysql.inc.php:
$db_hostname = "localhost:3306";
$db_database = "property_management";
$db_username = "property";
$db_password = "changedtoprotecttheinnocent";
$connection = mysql_connect($db_hostname, $db_username, $db_password) or die(mysql_error());
mysql_select_db($db_database, $connection);
function open_db_connection()
{
$connection = mysql_connect($db_hostname, $db_username, $db_password) or die(mysql_error());
mysql_select_db($db_database, $connection);
}
function close_db_connection()
{
if ($connection) { mysql_close($connection) ; }
}
The path to the include file is correct.
Permissions on the include are identical to those of the referrer. But have changed to 777 to test, and also attempted changing owner.
This code as it stands worked on a my desktop under MAMP.
Password and user in the include are correct: when I copy and paste it into the the actual script all of this works.
What I find odd, is that the db user is actually property, it is like the server is denying the existence of the include, it is trying to use a different user, and not what is declared in the include.
Again, if I put the very same connection data out of the include and put it exactly as is into the main script, it all works.
It would be awesome if someone could direct me to what I am "blatantly" overlooking.
Thank you greatly in advance.