I want to save QR code image into my database and retrieve it afterwards by calling an sql select statement on it and viewing on a table in my html page. I know to call the SQL statement, I just want to know whether is possible to do this.
<?php
header("Content-type: image/png");
require_once ('vendor/autoload.php');
enter code here
try{
$itemName = $_POST['item'];
$itemDesc = $_POST['description'];
$itemPrice = $_POST['price'];
$itemQuantity = $_POST['quantity'];
$itemExpiry = $_POST['expiry'];
$itemCat = $_POST['categoryChoice'];
$itemOffers = $_POST['offers'];
} catch(Exception $e){
die($e->getMessage());
}
/*$itemData=$list->posteddata($posts = array($_POST['item'],$_POST['description'],
$_POST['price'],$_POST['quantity'],$_POST['expiry'],$_POST['categoryChoice'],$_POST['offers']));*/
$size = isset($_POST['size']) ? (int)$_POST['size'] : 300;
$padding = isset($_POST['padding']) ? (int)$_POST['padding'] : 10;
$code = ($itemName . $itemDesc . $itemPrice . $itemQuantity .
$itemExpiry . $itemOffers . $itemCat);
$qr = new Endroid\QrCode\QrCode();
$qr->setText($code);
$qr->setSize($size);
$qr->setPadding($padding);
$qr->render();
?>