000webhost

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Post Reply
darspire
Posts: 194
Joined: Sat Jul 25, 2009 9:21 pm

000webhost

Post by darspire »

hey guys. i need someone that can help me with 000webhost. all my codes are for the WAMP server and not the 000webhost phpmyadmin server. and i keep getting errors. here is my error

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /home/a3925718/public_html/connect.php on line 3

Could not connect to db


my code is

Code: Select all

<?php

$db = mysql_connect("localhost","root","") or die("Could not connect to db");
if(!$db)
 die("no db");
if(!mysql_select_db("tutorial",$db))
 die("No Database Selected");
 
 ?>

what am i supposed to change it to? can anyone help me?
if you love something, let it go.
if it doesnt return.....hunt it down and kill it.
User avatar
Chris
Posts: 1581
Joined: Wed Sep 30, 2009 7:22 pm

Re: 000webhost

Post by Chris »

Code: Select all

mysql_connect("localhost","root","")
 
You'll need to change the host, username and password. The first parameter is the host, "localhost", the second the username, "root", and the last one that's blank will be the password.

If you're not sure what they are you should be able to find something in the help from your webhost.
Fighting for peace is declaring war on war. If you want peace be peaceful.
darspire
Posts: 194
Joined: Sat Jul 25, 2009 9:21 pm

Re: 000webhost

Post by darspire »

yea i know where to find everything. ill see if it works. thanks.

EDIT**
theres a sidebar in the phpmyadmin setting that says

Domain eternallegacy.webuda.com
Username a3925718
Password ******
Disk Usage 0 / 1500.0 MB
Bandwidth 100000 MB (100GB)
Home Root /home/a3925718
Server Name server42.000webhost.com
IP Address 64.120.149.69
Apache ver. 2.2.13 (Unix)
PHP version 5.2.*
MySQL ver. 5.0.81-community
Activated On 2010-11-24 02:43
Status Active

would the "root" part be the "/home/a3925718?
if you love something, let it go.
if it doesnt return.....hunt it down and kill it.
alexander19
Posts: 180
Joined: Fri Apr 02, 2010 1:05 pm

Re: 000webhost

Post by alexander19 »

the root part aka the username will probably be just: a3925718
darspire
Posts: 194
Joined: Sat Jul 25, 2009 9:21 pm

Re: 000webhost

Post by darspire »

so what would the host be?
if you love something, let it go.
if it doesnt return.....hunt it down and kill it.
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: 000webhost

Post by Callan S. »

Have you gone into their mySQL and made a database?

When you go in, it'll show your host information in bold. Just read through, you'll see it. Replace local host with this.

When you make a database it'll give you a MySQL User name. That's your 'root'.

And remember the password you chose when making the DB! That goes in the little talking marks after the root. And obviously don't post it here! Indeed don't post any of the above here! Just in case!

Also it'll give you 'MySQL Database'. In your code where it has 'tutorial' you will have to change it to what it tells you.


Anyway, log into 000webhost, go into the control panel and find MySQL under software/services. It's got a little picture of a dolphin!
Fight Cycle : My latest Browser game WIP
Driftwurld : My Browser Game WIP
Philosopher Gamer : My Blog
darspire
Posts: 194
Joined: Sat Jul 25, 2009 9:21 pm

Re: 000webhost

Post by darspire »

i did everything you said and it still says "Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a3925718'@'10.50.0.44' (using password: YES) in /home/a3925718/public_html/connect.php on line 3

Could not connect to db"
if you love something, let it go.
if it doesnt return.....hunt it down and kill it.
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: 000webhost

Post by Callan S. »

Okay, that's odd looking because you just have 'a3925718'. For mine, I have a letter and number like that, then an underline, then the name I chose.

You did actually create a database?

And you did choose a user name?

If you didn't and just left the field blank (not sure if that's possible, actually), then try 'a3925718_', with the underline after it, as it is part of the whole thing used.
Fight Cycle : My latest Browser game WIP
Driftwurld : My Browser Game WIP
Philosopher Gamer : My Blog
darspire
Posts: 194
Joined: Sat Jul 25, 2009 9:21 pm

Re: 000webhost

Post by darspire »

ope nvm i got it ^_^
if you love something, let it go.
if it doesnt return.....hunt it down and kill it.
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: 000webhost

Post by Callan S. »

your welcome
Post Reply

Return to “Advanced Help and Support”