I am much confuse about 000webhost database uploading I have set my database at their and accessing it with username and password perfectly. Now trying to connect with through PHP code but i am failed, getting 500 error code and no details of the error although I have also logged exception message in my connection code nuto it only showing "A Connection error has occurred" and nothing more:
//DB Configuration $hostName = 'localhost'; $dbUserName = 'id143984_jw_kioskuser'; $dbPassword = '***********'; $databaseName = 'id143984_jw_kiosk'; try{ $dbHandler = new PDO('mysql:host='. $hostName . ';dbname='. $databaseName, $dbUserName, $dbPassword); } catch(PDOException $ex){ echo '<h1>A Connection error has occurred.</h1><pre>', $e->getMessage() ,'</pre>'; echo $e->getMessage(); } My current DB interface at 000webhost saying me that "Use localhost as connection hostname" while in another post of 000WEbhost saying "Never use 'localhost' as your MySQL hostname! You can find your MySQL hostname by logging on to members area, entering control panel and clicking on MySQL icon."
HOw do i make successfull connection?