Click here to Skip to main content
Rate this: bad
good
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 6:56am
Comments
ThePhantomUpvoter at 29-Mar-13 11:58am
   
Is your MySql server on the localhost?

1 solution

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

Solution 1

Do you have a phpMyAdmin on the control panel? Did you try with that?
  Permalink  
Comments
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 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 OriginalGriff 120
3 PIEBALDconsult 110
4 BillWoodruff 85
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 29 Mar 2013
Copyright © CodeProject, 1999-2014
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