connect.php problem with 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.

connect.php problem with 000webhost

Postby ZeroComp » Mon Mar 15, 2010 9:00 pm

I keep getting this error even though I changed my server name


Warning: mysql_connect() [function.mysql-connect]: Host 'srv24.000webhost.com' is not allowed to connect to this MySQL server in /home/a5717883/public_html/connect.php on line 3
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
ZeroComp
 
Posts: 635
Joined: Thu Oct 29, 2009 2:48 pm

Re: connect.php problem with 000webhost

Postby jpoisson » Mon Mar 15, 2010 9:17 pm

Check to make sure that 000webhost servers are active.
jpoisson
 
Posts: 245
Joined: Sun Aug 02, 2009 11:12 am

Re: connect.php problem with 000webhost

Postby ZeroComp » Tue Mar 16, 2010 8:17 pm

It says Status:Active at the control panel and it till won't work
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
ZeroComp
 
Posts: 635
Joined: Thu Oct 29, 2009 2:48 pm

Re: connect.php problem with 000webhost

Postby jpoisson » Wed Mar 17, 2010 6:12 am

Send in a support ticket, or post a quick blurb of code to where the error is pointing too. *please remove all passwords and userinfo and replace it with fake foo based info*
jpoisson
 
Posts: 245
Joined: Sun Aug 02, 2009 11:12 am

Re: connect.php problem with 000webhost

Postby ZeroComp » Wed Mar 17, 2010 8:38 pm

here it is
Code: Select all
<?php

    $db = mysql_connect("server24.000webhost.com","password is here","") or die("Could not connect to db");
    if(!$db)
    die("no db");
    if(!mysql_select_db("a5717883_dire",$db))
    die("No Database Selected");

    ?>
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
ZeroComp
 
Posts: 635
Joined: Thu Oct 29, 2009 2:48 pm

Re: connect.php problem with 000webhost

Postby SpiritWebb » Thu Mar 18, 2010 10:28 am

ZeroComp wrote:here it is
Code: Select all
<?php

    $db = mysql_connect("server24.000webhost.com","password is here","") or die("Could not connect to db");
    if(!$db)
    die("no db");
    if(!mysql_select_db("a5717883_dire",$db))
    die("No Database Selected");

    ?>


It looks like to me, that you have your password, in the username section. Should be:

Code: Select all
$db = mysql_connect("server24.000webhost.com","username here","password here") or die("Could not connect to db");
Image
Computer: AMD Athlon64 X2, ATI Radeon HD, 320Gb HDD, 2Gb RAM, Windows XP Pro
Software: Paint Shop Pro 7.04, Blender 3d 2.49, Unity 3D 2.6, Flash MX 2004

Scorpius Studios
Undiscovered Online Wiki
Follow on twitter
User avatar
SpiritWebb
Scorpius Studios
 
Posts: 1330
Joined: Sun Jul 12, 2009 5:25 pm
Location: Conway, AR

Re: connect.php problem with 000webhost

Postby ZeroComp » Thu Mar 18, 2010 4:38 pm

Would my username be my 000webhost user-account?
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
ZeroComp
 
Posts: 635
Joined: Thu Oct 29, 2009 2:48 pm

Re: connect.php problem with 000webhost

Postby SpiritWebb » Thu Mar 18, 2010 5:00 pm

On your CPanel, click MySQL and it will tell you what your mysql host is for your account.

Than you have your database name: a9******** whatever your username is in account form. You can see it too your right while looking at the MySQL on the cpanel. When you create a new one, it has the auto username_ and a blank square for your choice, to create your database name. The user name and your password.

You will just replace the database name with the database name you chose...the host name you are connecting too and the user name and password. :) It should work.
Image
Computer: AMD Athlon64 X2, ATI Radeon HD, 320Gb HDD, 2Gb RAM, Windows XP Pro
Software: Paint Shop Pro 7.04, Blender 3d 2.49, Unity 3D 2.6, Flash MX 2004

Scorpius Studios
Undiscovered Online Wiki
Follow on twitter
User avatar
SpiritWebb
Scorpius Studios
 
Posts: 1330
Joined: Sun Jul 12, 2009 5:25 pm
Location: Conway, AR

Re: connect.php problem with 000webhost

Postby jpoisson » Thu Mar 18, 2010 5:01 pm

no it would have been the user name you made with the database.
jpoisson
 
Posts: 245
Joined: Sun Aug 02, 2009 11:12 am

Re: connect.php problem with 000webhost

Postby ZeroComp » Thu Mar 18, 2010 8:04 pm

alright thanks for your help guys :)
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
ZeroComp
 
Posts: 635
Joined: Thu Oct 29, 2009 2:48 pm

Next

Return to Help and Support

Who is online

Users browsing this forum: No registered users and 1 guest