Any short code to display images from from db in php only | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Any short code to display images from from db in php only

please notify me very short code...

7th Jun 2017, 2:58 PM
VIKASH KUMAR
VIKASH KUMAR - avatar
4 Answers
+ 1
If it's necessary then to keep your files directly in database you have to create the table with a column type BLOB. How to put the BLOB to database using PHP: http://php.net/manual/en/function.fbsql-create-blob.php And here is how to get the BLOB from database: http://php.net/manual/en/function.fbsql-read-blob.php
8th Jun 2017, 7:23 PM
Krzysztof Przybylowski
Krzysztof Przybylowski - avatar
+ 1
May I ask why do you want to keep the images in database? It's possible, of course, but it's not efficient at all. I suggest you to keep the images as a files on server and display them with <img> tag, getting at least the name of each image from database with PHP.
8th Jun 2017, 6:56 PM
Krzysztof Przybylowski
Krzysztof Przybylowski - avatar
0
yah that's right, but my client is demanding for this feature if it possible then explain me how?
8th Jun 2017, 6:58 PM
VIKASH KUMAR
VIKASH KUMAR - avatar
0
thanks, i'll be try to work on it...
8th Jun 2017, 7:25 PM
VIKASH KUMAR
VIKASH KUMAR - avatar