SELECT command denied to user

Status
Not open for further replies.

sfcpfc

New Member
Messages
3
Reaction score
0
Points
0
Hello. I just changed my hosting to x10hosting, and I uploaded my files and databases. Then, I got lots of errors when I used "mysql_query()". I looked for the mysql error and I got this:

SELECT command denied to user 'sfcpfcmw_bd'@'localhost' for table 'ejercitos'

I granted all the privileges to this user, using the x10hosting basic panel, but I'm still getting this error.

Can you help me? Thanks in advance.

Here's my code:

PHP:
<?php
$db_host        = 'localhost';
$db_user        = 'sfcpfcmw_bd';
$db_pass        = '/* I wont put this */';
$db_database    = 'sfcpfcmw_liga'; 

$link = mysql_connect($db_host,$db_user,$db_pass) or die('No se pudo conectar con la Base de Datos');
mysql_select_db($db_database,$link);
mysql_query("SET names ISO-8859-1");

require 'functions.php';

$resultado = mysql_query("SELECT * FROM `sfcpfcmw_liga`.`ejercitos` WHERE id = 1") or die(mysql_error()); // <--- Thist is when the error happens
$fila = mysql_fetch_assoc($resultado);

echo $fila['usr'];
?>
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
Please make sure you are using the correct database name, I see your database is called "sfcpfcmw_league", not "sfcpfcmw_liga"
 

sfcpfc

New Member
Messages
3
Reaction score
0
Points
0
Ok, that was! Thank you very much.
By the way, It's very strange that it returned this error, it would be more logic that it returns something like "Cannot find database" or "Cannot access database"... :/
 
Status
Not open for further replies.
Top