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

python 3 IndexError: list index out of range -

android - How to save instance state of selected radiobutton on menu -

IF statement in MySQL trigger -