Hi,
I am new to PHP.
I am having problem while connecting to MySQL database at a shared host using PHP.
My codings are as follows:-
<?php
//------create function to connect to MySQL database
function connectDB()
{
$server = "gus.gscit.monash.edu.au";
$user = "user10"; //---not the real username
$passwd = "3408"; //---not the real passwd
$connect = mysql_connect($server, $user, $passwd)
or die("Unable to connect to MySQL server");
/ connecting to database /
mysql_select_db("testDB");
return $connect;
}
However, when I execute the PHP page, error message as follow shown:-
Warning: mysql_connect(): Lost connection to MySQL server during query in /base/home/j/jmche10/public_html/connectDB.php on line 39
Unable to connect to MySQL server
Can anybody please help to enligten me in this problem? Appreciate prompt reply as I have deadline to meet.
Thank you very much in advance.
Rgds,
Des