I am connecting to a database, and the table name is members, and the database name is a3328465_login. I have this code:
$dbhost = "mysql15.000webhost.com"; $dbname = "members"; $dbuser = "a3328465_gopher"; $dbpass = "[color=gray]password[/color]";
But it came up:
Access denied for user 'a3328465_gopher'@'******' to database 'members'
What do I do?
Offline
frowned wrote:
um... free web hosts are known to be glitchy
No, it's an error with the code.
Offline
frowned wrote:
Well that code is correct. The problem lies somewhere else... is the SQL server running on a non-standard port?
no, it's something to do with the database name.
Offline
yes. I just need to know what do I put in. The name of the database or the name of the table?
Offline
I'm not a big fan of mySQL but I have some knowledge of it. Anyway you mostly need logic for what I'm about to point out:
WE wrote:
the table name is members, and the database name is a3328465_login.
WE wrote:
$dbhost = "mysql15.000webhost.com";
$dbname = "members";
$dbuser = "a3328465_gopher";
$dbpass = "password";
You basically answered you own question in the first post
The reason it's giving you that peculiar error instead of a database not found, is because 000webhost probably uses a mysql database called 'members'.
If you still didn't get the solution, change the line that says 'members' to 'a3328465_login'
Offline
LS97 wrote:
I'm not a big fan of mySQL but I have some knowledge of it. Anyway you mostly need logic for what I'm about to point out:
WE wrote:
the table name is members, and the database name is a3328465_login.
WE wrote:
$dbhost = "mysql15.000webhost.com";
$dbname = "members";
$dbuser = "a3328465_gopher";
$dbpass = "password";You basically answered you own question in the first post
![]()
The reason it's giving you that peculiar error instead of a database not found, is because 000webhost probably uses a mysql database called 'members'.
If you still didn't get the solution, change the line that says 'members' to 'a3328465_login'
it worked with a3328465_login, but it doesn't seem to be reading the "name" field because I get this error:
Unknown column 'name' in 'field list'
Offline
Well at least I was right...
I don't know enough SQL to give you an answer to the second problem.
Offline
LS97 wrote:
Well at least I was right...
![]()
I don't know enough SQL to give you an answer to the second problem.
Anyhow, why did you disable uploading on ModShare?
Offline
WindowsExplorer wrote:
LS97 wrote:
Well at least I was right...
![]()
I don't know enough SQL to give you an answer to the second problem.Anyhow, why did you disable uploading on ModShare?
Someone spammed it with 80 projects. Had to clean everything up and stuff.
Now that I've improved my anti-spam mechanisms, I think I'll put it back up
Offline
LS97 wrote:
WindowsExplorer wrote:
LS97 wrote:
Well at least I was right...
![]()
I don't know enough SQL to give you an answer to the second problem.Anyhow, why did you disable uploading on ModShare?
Someone spammed it with 80 projects. Had to clean everything up and stuff.
Now that I've improved my anti-spam mechanisms, I think I'll put it back up![]()
Are you going to use the IP blocking feature?
Offline
LS97 wrote:
WindowsExplorer wrote:
LS97 wrote:
Well at least I was right...
![]()
I don't know enough SQL to give you an answer to the second problem.Anyhow, why did you disable uploading on ModShare?
Someone spammed it with 80 projects. Had to clean everything up and stuff.
Now that I've improved my anti-spam mechanisms, I think I'll put it back up![]()
Can you put the red theme back? Or make it green? The blue is getting sort of old!
Offline
WindowsExplorer wrote:
LS97 wrote:
WindowsExplorer wrote:
Anyhow, why did you disable uploading on ModShare?Someone spammed it with 80 projects. Had to clean everything up and stuff.
Now that I've improved my anti-spam mechanisms, I think I'll put it back up![]()
Are you going to use the IP blocking feature?
Nope. Made my own so that I can tell the user they've been banned.
Anyway it is based on IP.
Mod Share's up and running! See announcements forum for details.
Offline
WindowsExplorer wrote:
LS97 wrote:
I'm not a big fan of mySQL but I have some knowledge of it. Anyway you mostly need logic for what I'm about to point out:
WE wrote:
the table name is members, and the database name is a3328465_login.
WE wrote:
$dbhost = "mysql15.000webhost.com";
$dbname = "members";
$dbuser = "a3328465_gopher";
$dbpass = "password";You basically answered you own question in the first post
![]()
The reason it's giving you that peculiar error instead of a database not found, is because 000webhost probably uses a mysql database called 'members'.
If you still didn't get the solution, change the line that says 'members' to 'a3328465_login'it worked with a3328465_login, but it doesn't seem to be reading the "name" field because I get this error:
Unknown column 'name' in 'field list'
php code?
Offline
Try this code: (I know alot about mysql)
$dbhost = "mysql15.000webhost.com"; $dbname = "a3328465_members"; $dbuser = "a3328465_gopher"; $dbpass = "[color=gray]password[/color]";
And what are you using this code for? Are you making a site?
Offline