Insert images in MariaDB

d's profile image d posted 8 hours ago in General Permalink

CREATE TABLE poi_images ( id INT(11) NOT NULL AUTO_INCREMENT, place_id INT(11) NOT NULL, filename VARCHAR(255) NOT NULL COLLATE 'utf8mb4_general_ci', description TEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci', uploaded_at TIMESTAMP NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (id) USING BTREE, INDEX place_id (place_id) USING BTREE, CONSTRAINT poi_images_ibfk_1 FOREIGN KEY (place_id) REFERENCES places (id) ON UPDATE RESTRICT ON DELETE CASCADE ) COLLATE='utf8mb4_general_ci' ENGINE=InnoDB ;

INSERT INTO poi_images (place_id, filename, description) VALUES (1,'C:\Users\User\OneDrive\Desktop\SEMESTER 8\PSM 1\imgs\putramosque.jpeg','credits to Wanderlog'), (2,'C:\Users\User\OneDrive\Desktop\BSC.GEOINFORMATICS\SEMESTER 8\PSM 1\imgs\putramosque1.jpeg','credits to Wanderlog');

I'm confused how to insert image into MariaDB? How to find the image's filename (relative path)?

Please login to leave a reply, or register at first.