i have a domain www.thesunriseschool.com
for connecting the database i am using
i have created , a user as welll as uploaded thedatabase using the cpanel of the domain successfully but it is giving me this error
Can Any one can help me.... i think i am not writing the exact parameters
Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'http' (1) in /home/thesun/public_html/includes/config.php on line 25
I cannot connect to the database because: Unknown MySQL server host 'http' (1)
for connecting the database i am using
Code:
<?php $sId=session_id(); $uIp=$_SERVER['REMOTE_ADDR']; $time=time(); $date_now=date("d/m/Y", $time); $time_now=date("G:i:s", $time); if(isset($_SERVER['HTTP_REFERER'])){ $referer=$_SERVER['HTTP_REFERER']; }else{ $referer="http://www.thesunriseschool.com"; } if($_SERVER['HTTP_HOST']=="localhost" || $_SERVER['HTTP_HOST']=="192.168.1.12"){ $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbname = 'Sunrise'; }else{ $dbhost = 'http://www.thesunriseschool.com/'; $dbuser = 'xxxxx'; $dbpass = 'xxxxx'; $dbname = 'thesun_Sunrise'; } $conn = mysql_connect ($dbhost, $dbuser, $dbpass) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ($dbname); function dbQuery($sql){ $qry=mysql_query($sql); return $qry;} ?>
i have created , a user as welll as uploaded thedatabase using the cpanel of the domain successfully but it is giving me this error
Can Any one can help me.... i think i am not writing the exact parameters
Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'http' (1) in /home/thesun/public_html/includes/config.php on line 25
I cannot connect to the database because: Unknown MySQL server host 'http' (1)
Comment