Need help to connect to my MySQL database.
Posted: Thu Dec 18, 2008 12:27 am
Hi,
I need some help to connect to my MySql database...i get the following error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on...
I'm trying to connect to a host through a port.
If i try to connect to one of my other databases with the same code then i connect without any errors.
Is there any problem with this...
could someone please help?
I need some help to connect to my MySql database...i get the following error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on...
I'm trying to connect to a host through a port.
If i try to connect to one of my other databases with the same code then i connect without any errors.
Code: Select all
<?php
$host = "some.where.com:3456";
$user = "user1";
$pass = "pass1@$";
$dbName = "myDb";
function connect()
{
$db = mysql_connect($GLOBALS["host"],$GLOBALS["user "],$GLOBALS["pass "]);
if ($db == false)
die("Error while connecting...");
mysql_select_db($GLOBALS['dbName"]), $db)
or die("Error...");
return $db;
}
?>
could someone please help?