in

How to insert image in mysql table, then displayed on the screen?


I have the following problem.
I need to print the pictures (the pictures are in mysql).
My mysql code is as follows:

CREATE TABLE Images (ID INT, NOT NULL AUTO_INCREMENT,
                     IMAGE BLOB,
                     PRIMARY KEY (ID)
);

And I inserted as follows:

INSERT INTO Images (IMAGE) VALUES (LOAD_FILE ('/Desktop/node/img/1.jpeg'));

Now I want those images to be displayed in my code (I write it in node.js).
When I write the following code, it prints only the IDs.

router.get ("/", (req, res, next) => {
     db.query ("SELECT * FROM Images", (err, row) => {
         if (err) {
             throw err:
         }
         else {
             res.render ("index", {data: row})
         }
     });
});

What can I do to get those pictures displayed on the screen?



Source: https://stackoverflow.com/questions/70714424/how-to-insert-image-in-mysql-table-then-displayed-on-the-screen

A Deep Learning Based Attendance System is a mobile application

Manage your pictures easily for Github