connect.php problem with 000webhost
connect.php problem with 000webhost
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
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
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
Re: connect.php problem with 000webhost
Check to make sure that 000webhost servers are active.
Re: connect.php problem with 000webhost
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
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
Re: connect.php problem with 000webhost
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*
Re: connect.php problem with 000webhost
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
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: connect.php problem with 000webhost
It looks like to me, that you have your password, in the username section. Should be:ZeroComp wrote:here it isCode: 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"); ?>
Code: Select all
$db = mysql_connect("server24.000webhost.com","username here","password here") or die("Could not connect to db");
Re: connect.php problem with 000webhost
Would my username be my 000webhost user-account?
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: connect.php problem with 000webhost
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.
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.
Re: connect.php problem with 000webhost
no it would have been the user name you made with the database.
Re: connect.php problem with 000webhost
alright thanks for your help guys 
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8

