Skip to content

Instantly share code, notes, and snippets.


codingwithsara/list.php Secret

Created Apr 5, 2019
What would you like to do?
Save Image File with PHP & MySQL - #4
require_once 'functions.php';
$pdo = connectDB();
// 画像を取得
$sql = 'SELECT * FROM images ORDER BY created_at DESC';
$stmt = $pdo->prepare($sql);
$images = $stmt->fetchAll();
} else {
// 画像を保存
if (!empty($_FILES['image']['name'])) {
$name = $_FILES['image']['name'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.