I am trying to insert an image into a longblob type field named 'img':
include('config.php');
$imgData = mysqli_real_escape_string($conn, file_get_contents($_FILES['im_age'] ['tmp_name']));
$qry=" insert into tblproducts(
vendorid, prefix, overallsize, handlematerial, img, code, itemcost, shippingcost,
profitpercentage, discountpercentage, caption, availability, quantity
)
values(
$_POST[vendor_id],
$_POST[pre_fix],
$_POST[overall_size],
$_POST[handle_material],
$imgData,
$_POST[co_de],
$_POST[item_cost],
$_POST[shipping_cost],
$_POST[profit_percentage],
$_POST[discount_percentage],
$_POST[cap_tion],
$_POST[avail_ability],
$_POST[quan_tity]
)
";
$result = mysqli_query($conn, $qry) or die("Could not execute query!");
EDIT: I get the following error: 'Could not execute query'
How do I make the insertion of the image happen? Thanks in advance!