Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created April 21, 2021 01:29
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 codeforfun-jp/30942db8abef6beec7b7baa48fb7b98b to your computer and use it in GitHub Desktop.
Save codeforfun-jp/30942db8abef6beec7b7baa48fb7b98b to your computer and use it in GitHub Desktop.
Save Image File with PHP & MySQL - #2
<?php
// データベースに接続
function connectDB() {
$param = 'mysql:dbname=my_image;host=localhost';
try {
$pdo = new PDO($param, 'root', 'root');
return $pdo;
} catch (PDOException $e) {
exit($e->getMessage());
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment