Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created October 14, 2019 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/34daa6a47afc509f36c05c85c49768e7 to your computer and use it in GitHub Desktop.
Save parzibyte/34daa6a47afc509f36c05c85c49768e7 to your computer and use it in GitHub Desktop.
<?php
/*
PHP and MySQL tutorial
https://parzibyte.me/blog/en
*/
$password = "";
$user = "root";
$databaseName = "mysql_tutorial";
try{
$database = new PDO('mysql:host=localhost;dbname=' . $databaseName, $user, $password);
}catch(Exception $e){
echo "Error connecting to db: " . $e->getMessage();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment