How to upload image to MySQL database and display it using php

Awa Melvine · 628K views · 2016 · 12:19

Open on YouTube

Web developmentDatabases & storagetutorial

Why Stack Overflow recommends it

Stack Overflow users link it when answering or asking how to upload images with PHP and MySQL and show them on a page, mostly as a worked example to follow.

Recommended by 2 people across 1 different months, 2017 to 2018.

What it is

A 12-minute step-by-step tutorial by Awa Melvine on uploading an image through a PHP form, saving its filename in a MySQL varchar column alongside other fields, moving the file into a server directory, and displaying it on a page with simple HTML and CSS.

What people said

Recommends Amr Aly · 2017-04 · Stack Overflow · on “Popover image on hover bootstrap table”

you need to allow the user to insert his chosen image into the database then pass the image with user info and in your html can make the images `display: none` and only if the user hovers over it you will show the image .check this tutorial [this video]

Recommends Aaron Owen · 2017-04 · Stack Overflow · on “Display image from xml - url is too long”

I have since realised it's easier to upload the images into the sites 'images' folder and to display them from there rather than place them into a database. I found a tutorial [this video] that may help others having this problem.

Cites Zeunee Lo · 2017-06 · Stack Overflow · on “Uploading photos in mysql and display using PHP”

Hello guys, please help! I'm having problems with my project, I followed these steps on how to upload( [this video] ) but something is wrong. The error is Notice: Undefined index: tmp_name in C:\xampp\htdocs\LDEVERACATERING\upload_process.php on line 16 Here is my upload.html <!DOCTYPE html> <html> <head> <script src="jquery-3.2.1.min"></script> <script src="jquery-migrate-1.4.1.min"></script> <title> Image Upload </title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div id="content"> <form method="POST" action="upload_process.php" enctype="multipart/form-data"> <input type="hidden" name="size" value="1000000"/> <div> <input type="file" name="image"/> </div> <div> <tex

Cites Coding Noob · 2018-08 · Stack Overflow · on “How to display image albums in posts? [using PHP and MYSQL only]”

I've tried some vanilla JS image slider, but still have the problems: - 1.) I only can have 1 slider on the website (because of "include_once img_slider.php", when I used "include", the website went going crazy) - 2.) I still have to know, how many images are in 1 post. I tried to make those static slider to a dynamic one (database based slider): [LINK] [this video] And I want to avoid third-party stuff, like bootstrap etc.