<?php
//DB
$db = "database";
$hostname = "localhost";
$password = "password";
$user = "user";
?>
If this is your config file (obviously the actual variable definitions are different), but if the variable names themselves look like this in your config file, then make thse changes:
1) Get the $dbDatabase variable out of your connect string.
and
2) Remove the double quotes, and use the same variable name for the database as in your config file.
Make these changes, exactly, and if this still doesn't work, then repost here (including the applicable contents of your config file)
<?php
include'conextion.php';
//connect to database server
$dataconx = @mysql_connect($hostname, $user, $password);
if (!$dataconx) {
die( '<P>Unable to connect to the database server at this time.</>' );
}
//connect to the database
mysql_select_db($db);
if (!@mysql_select_db($db) ) {
die( '<P>Unable to locate the database at this time.</P>' );
}
?>
Lastly, why are you using IF statements to write out your error, when mySQL give you the OR DIE option?