Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I run the php code on wamp server it runs fine..

but when i tried to run on my webhosting..
i am having an error establishing connecition.

here is the code

PHP
$dbhost = "localhost";// here  i think is problem


$dbuser = "suntafun_user";


$dbpass = "******";

$dbname = "suntafun_first";

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

mysql_select_db($dbname) or die ('Unable to select database!');

?>


i think the problem is in db host.. anyone please help
Posted
Comments
[no name] 29-Mar-13 11:58am    
Is your MySql server on the localhost?

1 solution

Do you have a phpMyAdmin on the control panel? Did you try with that?
 
Share this answer
 
Comments
codegeekalpha 30-Mar-13 15:38pm    
i have solved this problem.. actually dere is some firewall on my pc.. so its not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900