1

i have to connect to a mysql server from php program using pdo, problem is i cannot get it connected from php but i can connect it with same configuration using other SQL Managers.

parent::__construct('mysql'.':host='.$DB_HOST.';dbname='.$DB_NAME, $DB_USER, $DB_PASS);
Bijoy
  • 399
  • 2
  • 7
  • 15
  • What error are you getting? – Pekka Jun 01 '13 at 19:44
  • nothing to be precise. blank page. – Bijoy Jun 01 '13 at 19:44
  • 1) this question is not for SO, as there is no programming component involved, 2) if PHP connects from a remote server while the other managers connect from your local machine, the MySql configuration might treat these connection attempts differently. – Jon Jun 01 '13 at 19:44
  • 1
    [How to squeeze error message out of PDO?](http://stackoverflow.com/q/3726505) – Pekka Jun 01 '13 at 19:46
  • Try to use try and catch to see what exceptions appear. Also, try to see if value of the variable uses is correct. – Mihai8 Jun 01 '13 at 19:48
  • If you're going to try catch an exception, don't forget you need to set PDO's error reporting to Exceptions. – Phil Cross Jun 01 '13 at 19:59
  • SQLSTATE[HY000] [2003] Can't connect to MySQL server. Error message – Bijoy Jun 01 '13 at 20:05

0 Answers0