php - Turning image path into data suitable for storing in MySQL Blob -
i have file in location
$imgloc = "../images/bg.jpg";
how i:
- load image php variable
- turn blob suitable data type (if not already)
- insert mysql (if additional steps needed)
$imghandler = fopen (imgloc, 'rb'); // open read binary $imgcontent = fread ($imghandler , filesize ($imgloc)); // can store $imgcontent in mysql
Comments
Post a Comment