/* Database Stuff, do not modify below this line */
$connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd")
or die ("Couldn't connect to server.");
$db = mysql_select_db("$database_name", $connection)
or die("Couldn't select database.");
?>
but when i try to get into the database it gives me this
Warning: mysql_pconnect(): Access denied for user: 'abna@abna.ca@ensim.com' (Using password: YES) in /home/virtual/site82/fst/var/www/html/Vilky/Login/db.php on line 11
Couldn't connect to server.
that's the origin of the request (where the client is located; in this case the php-script) as seen by the mysql-server.
If you were on the same host it would print something like abna@abna.ca@localhost. Permissions can be granted (and denied) by the origin.
You should ask your provider how to connect to the server or -if you run this system- take a look at http://www.mysql.com/doc/en/Adding_users.html
in either case http://www.mysql.com/doc/en/Access_denied.html might shed up some light on this
First, use the mysql program to connect to the server as the MySQL root user:
shell> mysql --user=root mysql
Then you can add new users by issuing GRANT statements:
mysql> GRANT ALL PRIVILEGES ON *.* TO monty@localhost
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO monty@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT RELOAD,PROCESS ON *.* TO admin@localhost;
mysql> GRANT USAGE ON *.* TO dummy@localhost;
Ok, I follow the direction, but than it tells me to add users, yet it doesn't tell me where, just that connect as the root user.
P.S: I'm using PhpMyAdmin program.
Oh, and I'm wondering
What would be the database name?
abna_ca
or
users?
I think that if a person that register on the website, the file automatic adds the user on to my database, so I don't have to add users manually, right?
I was wondering if you could tell me what i should be checking here.
// check if the user info validates the db
$sql = mysql_query("SELECT * FROM users WHERE username='$username' AND
password='$password' AND activated='1'");
$login_check = mysql_num_rows($sql);
Please, and Thank You
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/virtual/site82/fst/var/www/html/VC/Login/checkuser.php on line 21