Cannot INSERT image from public_html/image to mysql table with BLOB
I set up table:
CREATE TABLE `db`.`fruit` ( `item` VARCHAR(40) NOT NULL , `image` BLOB NOT NULL ) ENGINE = InnoDB;
Try to insert image to mysql table
$item = 'banana';
$image = 'http://www.somesite.org/image/banana.jpg';
$con = new mysqli('localhost','','','db');
$sql = $con->prepare("INSERT INTO fruit (item, image) VALUES (?,?)");
$sql->bind_param("sb", $item, $image);
$sql->execute();
Managed to save 'banana' to the item column, but image column is empty. I expect BLOB to be store to image column.
What have I done wrong??