Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "Conectando...";
- $host = "mysql:unix_socket=/cloudsql/ID_INSTANCIA;dbname=NOME_BANCO";
- $user = "USUARIO";
- $password ="SENHA";
- try{
- // create a PDO connection with the configuration data
- $conn = new PDO($host, $user, $password);
- // display a message if connected to database successfully
- if($conn){
- echo "Connected database successfully!";
- }
- } catch (PDOException $e) {
- // report error message
- echo $e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement