This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-09-06 14:26:40

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

PHP More Helps!

I am connecting to a database, and the table name is members, and the database name is a3328465_login. I have this code:

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?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#2 2011-09-06 14:29:20

frowned
Scratcher
Registered: 2010-11-02
Posts: 42

Re: PHP More Helps!

um... free web hosts are known to be glitchy

Offline

 

#3 2011-09-06 14:30:56

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: PHP More Helps!

frowned wrote:

um... free web hosts are known to be glitchy

No, it's an error with the code.


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#4 2011-09-06 14:43:43

frowned
Scratcher
Registered: 2010-11-02
Posts: 42

Re: PHP More Helps!

Well that code is correct. The problem lies somewhere else... is the SQL server running on a non-standard port?

Offline

 

#5 2011-09-06 14:44:43

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: PHP More Helps!

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.


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#6 2011-09-06 15:21:25

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: PHP More Helps!

read the message: this user doesn't have the permissions

Offline

 

#7 2011-09-06 15:23:53

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: PHP More Helps!

Yea, but what do I do?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#8 2011-09-06 15:44:36

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: PHP More Helps!

you know google?

Last edited by roijac (2011-09-06 16:10:44)

Offline

 

#9 2011-09-06 15:49:45

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: PHP More Helps!

yes. I just need to know what do I put in. The name of the database or the name of the table?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#10 2011-09-06 16:01:36

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: PHP More Helps!

WindowsExplorer wrote:

yes. I just need to know what do I put in. The name of the database or the name of the table?

see, i don't know php or mySql, you probably have to ask sparks or LS97 if you didn't fnd the answer  sad

Offline

 

#11 2011-09-06 16:04:09

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

Re: PHP More Helps!

roijac wrote:

you know google?

You use Ubunt, dont you.

I can tell


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

#12 2011-09-06 16:13:04

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: PHP More Helps!

oh, i HATE this happen...
and you're using Windows  tongue
not going to tell how i found out...

Offline

 

#13 2011-09-06 16:15:37

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: PHP More Helps!

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  tongue

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

 

#14 2011-09-06 16:19:51

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: PHP More Helps!

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  tongue

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'


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#15 2011-09-06 16:23:10

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: PHP More Helps!

Well at least I was right...  tongue

I don't know enough SQL to give you an answer to the second problem.

Offline

 

#16 2011-09-06 16:24:04

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: PHP More Helps!

LS97 wrote:

Well at least I was right...  tongue

I don't know enough SQL to give you an answer to the second problem.

Anyhow, why did you disable uploading on ModShare?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#17 2011-09-06 16:30:34

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: PHP More Helps!

WindowsExplorer wrote:

LS97 wrote:

Well at least I was right...  tongue

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  smile

Offline

 

#18 2011-09-06 16:33:13

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: PHP More Helps!

LS97 wrote:

WindowsExplorer wrote:

LS97 wrote:

Well at least I was right...  tongue

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  smile

Are you going to use the IP blocking feature?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#19 2011-09-06 16:36:51

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: PHP More Helps!

LS97 wrote:

WindowsExplorer wrote:

LS97 wrote:

Well at least I was right...  tongue

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  smile

Can you put the red theme back? Or make it green? The blue is getting sort of old!


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#20 2011-09-06 16:37:19

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: PHP More Helps!

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  smile

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

 

#21 2011-09-07 01:04:35

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: PHP More Helps!

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  tongue

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

 

#22 2011-09-07 01:47:07

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: PHP More Helps!

Try this code: (I know alot about mysql)

Code:

$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?


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

Board footer