[SOLVED] Connecting to a db
Posted: Tue Dec 02, 2003 10:10 am
i wrote a registration script that writes given information to my database, but my problem is i cant connect to the database, heres my db connection code.
db.php
___________________________________
the odd thing is that when i run it on my local server it executes and connects to the server exactly how i want it to, but as soon as i upload it to my web server and try to execute it, it cont connect to the server
db.php
Code: Select all
<?
$dbhost = 'www.freesql.org';
$dbusername = 'dull1554';
$dbpasswd = 'andrew';
$database_name = 'complexscripting';
$connection = mysql_connect("$dbhost","$dbusername","$dbpasswd") or die ("Couldn't connect to server.");
$db = mysql_select_db("$database_name", $connection) or die ("Couldn't select database.");
?>the odd thing is that when i run it on my local server it executes and connects to the server exactly how i want it to, but as soon as i upload it to my web server and try to execute it, it cont connect to the server
Warning: mysql_connect(): Can't connect to MySQL server on 'www.freesql.org' (10060) in d:\web\dull1554\db.php on line 10
Couldn't connect to server.