How to Insert Images to MySQL and Display Them Using PHP

  Рет қаралды 493,274

Clever Techie

Clever Techie

Күн бұрын

Upgrade your Clever Techie learning experience:
/ clevertechie
UPDATE! (9/13/19) New features and improvements for Clever Techie Patreons:
1. Download full source code with detailed comments - easy to learn and understand code
2. Weekly source code file updates by Clever Techie - every time I learn new things about a topic I will add it to the source file and let you know about the update - keep up with the latest coding technologies
3. Library of custom Clever Techie functions with descriptive, easy to understand comments - skyrocket coding productivity, code more efficiently by using Clever library of custom re-usable functions
4. Syntax code summary - memorize and review previously learned code faster
4. Organized file structure - access all Clever Techie lessons, source code, graphics, diagrams and cheat sheet from a single workspace - no more searching around for previously covered material and source code - save enormous amount of time and effort
5. Outline of topics the source file covers - fast review of all previously learned coding lessons
6. Access to all full HD 1080p videos with no ads
7. Console input examples - interactive examples that make it easier to understand and learn coding
8. Access to updated PHP Programming Book by Clever Techie
9. Early access to Clever Techie videos
Subscribe to Clever Techie patreon:
/ clevertechie
In this video we're going to learn how to insert images to MySQL database and then display them in a browser. We re-use the code from the multiple upload file video because we're still going to be uploading images to a web site, and then pulling the directory names from that folder to display the images from MySQL table.
``````````````````````````````````````````````````````````````````````````````````````````````
Hey guys, I'm now using Patreon to share improved and updated video content and source files. For a small fee you can access all the downloadable files from this lesson (source code, icons & graphics, cheat sheets, OneNote notes) and everything else included in the video from the Patreon page. Additionally, you will get access to ALL Clever Techie videos in HD format with no ads. Thank you so much for supporting Clever Techie :)
Download this video's files here:
/ 21026294
( You also get access to ALL source code and any downloadable content of ALL Clever Techie videos, as well as access to ALL videos in HD 1080p quality format with all video ads removed! )
``````````````````````````````````````````````````````````````````````````````````````````````
( Website ) clevertechie.com - PHP, JavaScript, Wordpress, CSS, and HTML tutorials in video and text format with cool looking graphics and diagrams.
( KZfaq Channel ) / clevertechietube
( Google Plus ) goo.gl/J71p6f - clever techie video tutorials.
( Facebook ) / clevertechie
( Twitter ) / theclevertechie

Пікірлер: 113
@dibraniuk
@dibraniuk 5 жыл бұрын
Great tutorials ; Clever Techie will be missed .
@codemon_
@codemon_ 5 жыл бұрын
Hello techie... I think for multiple images ,consider hashing the image names or generating some random figures for each image it would help when one tries to upload similar image name and type so to avaoid redundancy
@DylanNeo
@DylanNeo 5 жыл бұрын
What is the point of a tutorial where you copy code from somewhere else you've written that you expect us to pay for?
@Vichion
@Vichion 4 жыл бұрын
Thank you.
@yogeshbhatt388
@yogeshbhatt388 4 жыл бұрын
saved from watching his video
@naimroslann
@naimroslann 4 жыл бұрын
LOUDER
@realdvgarg
@realdvgarg 4 жыл бұрын
saved 15 minutes.
@fredericklowe568
@fredericklowe568 3 жыл бұрын
I laughed when they wanted $5 for the source. OMG how lame. I am sure I can find it somewhere else for free. Thanks for nothing Clever Techie. ROFLOL
@timoanjala4358
@timoanjala4358 5 ай бұрын
Nice, very useful video! I will look through your other tutorials too!
@dibraniuk
@dibraniuk 5 жыл бұрын
Clever Techie has contributed a lot to the online free learning so thumbs up and thanks.
@Ronnie_S
@Ronnie_S 2 жыл бұрын
Thank you so much! Your $img_dir variable demonstration at the 5:00-6:00 mark helped me resolved my display image dilemma!
@VFRodriguez
@VFRodriguez 4 жыл бұрын
Good job. Well done. I have learned a lot with you. (And I am 64 )
@valentinobahati9947
@valentinobahati9947 3 жыл бұрын
ya it is a nice video but you can check also this y2u.be/Hf8bJiRBPio
@DiyintheGhetto
@DiyintheGhetto Жыл бұрын
Hello, I have a question. Is it possible to generate a link after uploading the image? What I mean is I would like to upload a image to the database and have a link generated so when I go to that link it will display that image and nothing else?
@VFRodriguez
@VFRodriguez 5 жыл бұрын
Good job. God bless you.
@poorboy2400
@poorboy2400 5 жыл бұрын
how can i put this in a form along with other information ???
@cedrio1027
@cedrio1027 4 жыл бұрын
thx man you helped me
@crunchraven000
@crunchraven000 2 жыл бұрын
Do you know how can i save to xampp to a table name results, to have a row by id of user?(user is another table)
@ahmoahmic1393
@ahmoahmic1393 5 жыл бұрын
how to in this code get image size extension and format
@yasyashu3092
@yasyashu3092 5 жыл бұрын
how to download ur source code?
@eriayoumadeitbralameck3205
@eriayoumadeitbralameck3205 2 жыл бұрын
awesome video nice programming tutorial
@samrudhipatil3812
@samrudhipatil3812 3 жыл бұрын
How to align images ?? Like i want 4 images in 1 row next 4 images in 2nd row
@zoltanfelhazi8446
@zoltanfelhazi8446 5 жыл бұрын
You are a king :3
@caringtoolsrizqif7190
@caringtoolsrizqif7190 3 жыл бұрын
Great Tutorials, can you do it in videos except images? Good to know :)
@adarshprabhalakumar6804
@adarshprabhalakumar6804 3 жыл бұрын
You can add more image field in one table
@chrislx7007
@chrislx7007 5 жыл бұрын
Thank You
@valentealejandroguardiolab5752
@valentealejandroguardiolab5752 Жыл бұрын
i have a question if somebody can help me im doing a proyect almost like a store i have to put images in cards to display for the costumer using an admin view the problem is when i try to call the image from the database to to be shown in the card it doesnt work it just appears an icon of a little paper with green
@JeremieNtiti-qh4on
@JeremieNtiti-qh4on Ай бұрын
Cette vidéo m'a été très utile !
@t2gamerz4
@t2gamerz4 2 жыл бұрын
img_dir is stored in php myadmin but / is missing that is why it is not showing up in the display.php. any help? i used print_r to see the img_dir. it is upload/pic.jpg. but / is not stored in phpmyadmin. any help plz?
@ony6182
@ony6182 3 жыл бұрын
DONE! thankyou 😁👍
@valentinobahati9947
@valentinobahati9947 3 жыл бұрын
nice video you can also check this one too y2u.be/Hf8bJiRBPio
@TECLOVENIA
@TECLOVENIA 3 жыл бұрын
Hello bro, I would like to ask you to kindly teach how to retrieve students marksheet with profile image. Thank you.
@muhammadyusmanal-arifbinma9718
@muhammadyusmanal-arifbinma9718 Жыл бұрын
Thanks and its work for my project but i cant upload my image using safari(ios Browser) when i upload it in my webhost
@lisheng262
@lisheng262 Жыл бұрын
12:32 Why not to use Factory inside the while loop?
@universe3258
@universe3258 4 жыл бұрын
Excuse me! Can we add some other form fields (e.g. description, address, email..) to the multiupload insert them to the database too? if yes, how can we do that? Thank you!
@productivearab9438
@productivearab9438 4 жыл бұрын
Gam Nguyen create another table and upload form with the .txt holding the information and rinse and repeat with the images. You will have to tweak it to the new table and .txt extension
@universe3258
@universe3258 4 жыл бұрын
@@productivearab9438 Thank you! Please confirm if I understand correctly: You mean I should create two tables, linking them using foreign key, then insert the text form data in one table and the images in another table?
@Mathsbom
@Mathsbom 3 жыл бұрын
Can you create a vedio for creating the image slide show with same method plz
@WolF-GameR-For-Games
@WolF-GameR-For-Games 7 ай бұрын
When I send more than 20 images together, only the first 20 images reach the database. What is the solution?
@analie1372
@analie1372 2 жыл бұрын
can u do display if image is click
@joshuacoonghe1854
@joshuacoonghe1854 3 жыл бұрын
bro i couldn't get the source code
@nilagangKamoteQ
@nilagangKamoteQ 10 ай бұрын
I am sorry. I can't donate to your Patreon. I want to but I can't. I am just a student. I like your video. It helps me a lot. If I graduate and got a dissent job, I will support your Patreon. But for now I will subscribe to your channel and like videos. Thank you!
@AbdulRahman-gb8wz
@AbdulRahman-gb8wz 2 жыл бұрын
How do I add text to speech into it
@venkatasulochanapolisetty1139
@venkatasulochanapolisetty1139 2 жыл бұрын
nice tutoriai video
@t2gamerz4
@t2gamerz4 2 жыл бұрын
thanks. I want to hug you man love you :) God bless you
@calebterawskyj5366
@calebterawskyj5366 5 жыл бұрын
Rip to newsletter, press F
@jubaerrahman5464
@jubaerrahman5464 Жыл бұрын
nice ❤❤
@lashmidaryanani3640
@lashmidaryanani3640 5 жыл бұрын
bro can u plzz give the source code i really appreciate ur work
@vitufez843
@vitufez843 2 жыл бұрын
thanks bro
@clevertechie
@clevertechie Жыл бұрын
Welcome
@anthonyoburu
@anthonyoburu 2 жыл бұрын
Hi. please can you do a tutorial to show how one can display an image dynamically on one's website from an online database registration page where you don't have the images locally on your computer. Thank you.
@onadiranbayonle2368
@onadiranbayonle2368 Жыл бұрын
hey anthony, do you find solution to your question yet? I need help on it too. if you do, please share
@bashmunir3928
@bashmunir3928 Жыл бұрын
​@@onadiranbayonle2368 I'm also finding a problem with this, if u have gotten a solution plz help me out
@ibnOrfi
@ibnOrfi Жыл бұрын
Firebase could be the answer to what you guys are looking for maybe?
@onadiranbayonle2368
@onadiranbayonle2368 Жыл бұрын
@@bashmunir3928 check this out, does it answer your question if(isset($_FILES['image'])){ $generalError = ''; $fileName = $_FILES['image']['name']; $fileSize = $_FILES['image']['size']; $fileTmp = $_FILES['image']['tmp_name']; $fileType = $_FILES['image']['type']; $fileExt = strtolower(pathinfo($fileName, PATHINFO_EXTENSION)); $extensions = array('jpeg', 'jpg', 'png'); if(! file_exists($fileTmp)){ $imageExisteneceError = 'choose image file to upload'; } elseif(! in_array($fileExt, $extensions)){ $imageExtensionError = 'please choose the image which has the as jpeg, jpg, png'; } elseif($fileSize > 1000000){ $imageSizeError = 'sorry, file should not be than 1MB'; } else{ move_uploaded_file($fileTmp, "blogPhotoUpload/".$fileName); $insertBlogPostQuery = "INSERT INTO blogpost (post_title,post_image, post_content) VALUES ('$postTitle', '$fileName', '$postContent')" ; $result = mysqli_query($conn, $insertBlogPostQuery); if (!$result) { die ('query failed'); }
@samj94
@samj94 3 жыл бұрын
How to store finger print using arduino
@Qubson._.
@Qubson._. 2 ай бұрын
Fatal error: Uncaught Error: Call to undefined function reArrayFiles() - why?
@hutyinsight1306
@hutyinsight1306 2 жыл бұрын
can you style the images and make them be in one table with proper arrangement.. NICE VIDEO
@ovarer
@ovarer 2 жыл бұрын
Echo is used to write HTML using PHP so just do CSS in the echo elemenets
@tranhoang5825
@tranhoang5825 2 жыл бұрын
this is video good
@dogvscatfunny9956
@dogvscatfunny9956 Жыл бұрын
А что просто путь прописать в БД нельзя на картинку?
@eizzuliman2456
@eizzuliman2456 4 жыл бұрын
can this code be use in notepade ++?>
@sohamzemse
@sohamzemse 5 жыл бұрын
You could do better. You could store the image data in BLOB type and retrieve it directly. Why need to store it in some directory? And you ask people to pay you and you show them this.
@janlawrence12
@janlawrence12 2 жыл бұрын
link source code pls^^
@downloadhome1342
@downloadhome1342 4 жыл бұрын
Dude Can You Do Pdf files
@liudasstonys1293
@liudasstonys1293 5 жыл бұрын
You don't insert images, just their path...
@theekingyodah1431
@theekingyodah1431 4 жыл бұрын
how can i do that
@liudasstonys1293
@liudasstonys1293 4 жыл бұрын
@@theekingyodah1431, images' data is in the form of byte array. Save that in images table data column and you'll be fine ;)
@cheongjiayun3901
@cheongjiayun3901 5 жыл бұрын
bro i got this why this would happened?:Uncaught Error: Call to undefined function reArrayFiles()
@Shahzaib.55
@Shahzaib.55 Жыл бұрын
how to get source code?
@clevertechie
@clevertechie Жыл бұрын
Subscribe to my patreon - patreon.com/clevertechie
@ajanthalakmal
@ajanthalakmal 5 жыл бұрын
unlike an report from me to paying you for code
@khansawidhani9899
@khansawidhani9899 3 жыл бұрын
We are here to learn. We don't want to copy your existing code from somewhere. Why you edited the existing code? Not recommended for beginners.
@hazratbilal699
@hazratbilal699 5 жыл бұрын
Sir, this is very helpful, sir i need this code, i will pay but i am from pakistan and there is no system of paypal, so can you please also share the source code,it will be very kind of you ! Thanks
@harshdhillon7160
@harshdhillon7160 4 жыл бұрын
paypal is online could be use anywhere xoxo
@johnberttubal985
@johnberttubal985 5 жыл бұрын
Can somebody post the code on comment. haha. I'am broke right now
@Alex_Eicher
@Alex_Eicher 5 жыл бұрын
At 9:56 i think "missing echo" .... 10:05 voila... :-)
@clevertechie
@clevertechie 5 жыл бұрын
;)
@zoherarnb3146
@zoherarnb3146 Жыл бұрын
@tahashameli7699
@tahashameli7699 Жыл бұрын
you have a cold, don't you??😅😂
@oldguy8177able
@oldguy8177able Ай бұрын
does not work
@justanickname8960
@justanickname8960 4 жыл бұрын
"How to insert images to MySql..." I'm still waiting for you to show this, as you only inserted their names. Why do lie to ppl in the title of your video...?
@corporacionbhcorporacionbh923
@corporacionbhcorporacionbh923 3 жыл бұрын
Insert in the bd images isn't a good idea, although you can do it but is a bad practice. With mysql only inserted the name not the images. Imagine for a second that u' insert in your db thousands images.... The bd colapse. At the first seconds of the video he was create two folders, local and web.. Web is the folder that you have in your server (proyect folder), it's where u' insert your images. And in the bd you insert the name for this images.
@ujjvalw2684
@ujjvalw2684 4 жыл бұрын
@dfdfg5646er
@dfdfg5646er 5 жыл бұрын
u just doing business here.. u didnt even show us code.. this is not tutorial .. dislikes
@alextwo4543
@alextwo4543 3 жыл бұрын
Mistake from 1st line :( 🤦‍♂️
@ShamoOoS25
@ShamoOoS25 5 жыл бұрын
Hi
@ISLaM-fh6ov
@ISLaM-fh6ov 4 жыл бұрын
9:56 10:05
@fredericklowe568
@fredericklowe568 3 жыл бұрын
Don't bother. Unless you want to pay for the source code.
@rickylove1449
@rickylove1449 3 жыл бұрын
I tried storing the image as a BLOB in MySql, but the server kept timing out on and insert. That led me to this video.
@mariusbruviksinnes2978
@mariusbruviksinnes2978 4 жыл бұрын
That nose is killing me
@mainurrifqizidan9557
@mainurrifqizidan9557 4 жыл бұрын
kkkkkkkk this is marketing
@surajsharma007
@surajsharma007 5 жыл бұрын
noob, so much confusion ,
@muhammadferozk
@muhammadferozk 4 жыл бұрын
just wast of time
@computerworld3835
@computerworld3835 4 жыл бұрын
time wasting
@abdulsalam-tw1gi
@abdulsalam-tw1gi 3 жыл бұрын
waste of time
@hasanafzal5892
@hasanafzal5892 4 жыл бұрын
not good teacher
@ankitmeher102
@ankitmeher102 2 жыл бұрын
Delete this video bro 😂😂
@codemon_
@codemon_ 5 жыл бұрын
Hello techie... I think for multiple images ,consider hashing the image names or generating some random figures for each image it would help when one tries to upload similar image name and type so to avaoid redundancy
How to Upload Images into MySQL Database and Display it using PHP
33:26
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 89 МЛН
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 20 МЛН
How to Fetch / Display an IMAGE from DataBase using PHP Mysql
16:20
Funda Of Web IT
Рет қаралды 115 М.
User Registration Form with PHP and MySQL Tutorial
25:02
Clever Techie
Рет қаралды 615 М.
How to upload image to MySQL database and display it using php
21:06
Coding with Elias
Рет қаралды 284 М.
52: How to upload profile images to users using PHP - PHP tutorial
51:02
How to Upload Image into Database and Display it using PHP
10:50
Code With Yousaf
Рет қаралды 35 М.
How to Learn to Code FAST (Do This or Keep Struggling)
11:00
Andy Sterkowitz
Рет қаралды 692 М.
Upload Multiple Files and Images in PHP
14:59
Clever Techie
Рет қаралды 42 М.
Let me show you (P1)
0:21
Discovery Boy
Рет қаралды 7 МЛН
Jesus vs devil #jesus #devil
0:26
jesus my love
Рет қаралды 15 МЛН
Respect 😱🔥 #shorts #respect #viral
0:31
MG RESPECT KING
Рет қаралды 34 МЛН
Chúa ơi - Hãy thử cái này #automobile #funny #shorts
0:12
hoang quach
Рет қаралды 10 МЛН
Berbagi lolipop ke orang buntung‼️
0:14
Abil Fatan Key
Рет қаралды 6 МЛН