Page 1 of 1
x10hosting [database help]
Posted: Mon Oct 31, 2011 8:05 am
by darspire
k so im using a new host its free its called x10hosting.com.
i have my database all created and all my codes, but when i go into register.php ( on the site) it says could not connect to db. im not sure what to put for localhost and what to put for the last set of "". please help
Re: x10hosting [database help]
Posted: Mon Oct 31, 2011 1:45 pm
by Gustava
Code: Select all
$db = mysql_connect("localhost", "root", "") or die("Could not connect.");
If you are running it off your computer just use localhost, and the password (Last set of " ") is blank unless you specifically change it.
Re: x10hosting [database help]
Posted: Mon Oct 31, 2011 9:04 pm
by Jackolantern
Are you using the database on their host? If so, they have to give you the login info since of course they won't give you admin privileges. You have to request them to make you a database, and they will give you a login for it, likely with a long sequence of characters in it since it will be made by the system. If they have cPanel, there should be an option there to make one.
If you are trying to host the database yourself but have the site hosted with the webhost (probably not a good idea), you will have to have a static IP on your computer so that the web host can reach your computer at all times with one URL.