Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Enter PORT, THE_DB_NAME, THE_DB_USER and THE_DB_PASSWORD to connect with PDO.
- // Traditional port is 3306 while I often use 8889 on my local dev machine.
- try{
- $dbh = new pdo( 'mysql:host=localhost:PORT;dbname=THE_DB_NAME',
- 'THE_DB_USER',
- 'THE_DB_PASSWORD',
- array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
- die(json_encode(array('outcome' => true)));
- }
- catch(PDOException $ex){
- die(json_encode(array('outcome' => false, 'message' => $ex->getMessage())));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement