I am trying to store employee ID picture to my DB with the ID# as the primary key. Yes I know storing the images to the database will put a heavier load on the DB however when I try:
INSERT INTO `companydatabase`.`employee_pic` (`emp_id`, `emp_pic`) values(100, LOAD_FILE('D:\\ID.png'));
INSERT INTO employee_pic values(100, LOAD_FILE('D:\ID.png'));
it replies:
Error Code: 1048. Column 'emp_pic' cannot be null
Columns below:
emp_id int(5) Nullable = No
emp_pic blob Nullable = No
&
|Variable_name |Value
-----------------------------------
|max_allowed_packet |52428800
It's strange but when I use the GUI interface in workbench it uploads the image but the script it provides is useless:
INSERT INTO `companydatabase`.`employee_pic` (`emp_id`, `emp_pic`) VALUES ('100', ?);
The most important part comes back as a question sign???
NB: Sidenote this DB will be accessed using Python not PHP or Js. I just need to find out the MySQL query to upload the ID images to the DB, that is literally the only issue I have atm, I am using MySQL Workbench 8.0.
/instead of the windows back slash