Click here to Skip to main content
11,802,442 members (71,544 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: PHP
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

$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 29-Mar-13 5:56am
ThePhantomUpvoter at 29-Mar-13 11:58am
Is your MySql server on the localhost?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Do you have a phpMyAdmin on the control panel? Did you try with that?
farooqspecials at 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)

  Print Answers RSS
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 Afzaal Ahmad Zeeshan 230
4 CPallini 230
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,645
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 29 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100