2 Days to find the way and nothing happened. How can i insert image blob directly from shell script and display the image by php files?
Shell script :
#!/bin/bash
DB_USER = "root";
DB_PASS = "";
DB_NAME = "raven";
TABLE = "gambar";
killall motion
sleep 1
TANGGAL = $(date +"%Y-%m-%d_%H-%M-%S");
raspistill -t 2000 -w 1280 -h 720 -q 100 -o /var/www/html/$TANGGAL.jpg
sleep 1
mysql --user=$DB_USER --password=$DB_PASS $DB_NAME << EOF
INSERT INTO $TABLE VALUES (NULL,$TANGGAL, LOAD_FILE('/var/www/html/$TANGGAL.jpg'));
EOF