Click here to Skip to main content
13,045,790 members (47,014 online)
Rate this:
Please Sign up or sign in to vote.
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

$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 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 29 Mar 2013
Copyright © CodeProject, 1999-2017
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