ShootingBlanks
09-28-2007, 07:29 PM
When I use this code:
$link = mysql_connect($hostname_SalesRepository, '*user*', $password_SalesRepository, 'salesrepository');
/* check connection */
if (!$link) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
printf("Host information: %s\n", mysql_get_host_info($link));
Everything works and I get the following message:
Host information: Localhost via UNIX socket
But when I use THIS code:
$link = mysqli_connect($hostname_SalesRepository, '*user*', $password_SalesRepository, 'salesrepository');
/* check connection */
if (!$link) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
printf("Host information: %s\n", mysqli_get_host_info($link));
Nothing works, and I get THIS message:
Connect failed: Access denied for user '*user*'@'localhost' to database 'salesrepository'
Can anyone help me out with this??? Thanks!...
MOD EDIT: Replaced username with *user* for security. Two pieces to the puzzle are better for stopping a potential hacker. Don't give out the username either.
$link = mysql_connect($hostname_SalesRepository, '*user*', $password_SalesRepository, 'salesrepository');
/* check connection */
if (!$link) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
printf("Host information: %s\n", mysql_get_host_info($link));
Everything works and I get the following message:
Host information: Localhost via UNIX socket
But when I use THIS code:
$link = mysqli_connect($hostname_SalesRepository, '*user*', $password_SalesRepository, 'salesrepository');
/* check connection */
if (!$link) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
printf("Host information: %s\n", mysqli_get_host_info($link));
Nothing works, and I get THIS message:
Connect failed: Access denied for user '*user*'@'localhost' to database 'salesrepository'
Can anyone help me out with this??? Thanks!...
MOD EDIT: Replaced username with *user* for security. Two pieces to the puzzle are better for stopping a potential hacker. Don't give out the username either.