php - Turning image path into data suitable for storing in MySQL Blob -


i have file in location

$imgloc = "../images/bg.jpg"; 

how i:

  1. load image php variable
  2. turn blob suitable data type (if not already)
  3. insert mysql (if additional steps needed)

$imghandler = fopen (imgloc, 'rb'); // open read binary $imgcontent = fread ($imghandler , filesize ($imgloc)); // can store $imgcontent in mysql 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -