I have a Retail program that can generate Shelf Tags , but I can't get past this error.
Bad query: /fannie/item/addShelfTag1.php: SELECT * FROM shelftags where upc = '0000000092837' and id=
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Heres File ShelfTag1.php
require('../config.php');
require_once($FANNIE_ROOT.'src/mysql_connect.php');
$id = 0;
$upc = $_REQUEST['upc'];
$description = $_REQUEST['description'];
$brand = $_REQUEST['brand'];
$units = $_REQUEST['units'];
$size = $_REQUEST['size'];
$ppo = $_REQUEST['ppo'];
$vendor = $_REQUEST['vendor'];
$sku = $_REQUEST['sku'];
$price = $_REQUEST['price'];
$id = $_REQUEST['subID'];
$checkUPCQ = "SELECT * FROM shelftags where upc = '$upc' and id=$id";
$checkUPCR = $dbc->query($checkUPCQ);
$checkUPCN = $dbc->num_rows($checkUPCR);
$insQ = "";
if($checkUPCN == 0){
$insQ = "INSERT INTO shelftags VALUES($id,'$upc','$description',$price,'$brand','$sku','$size','$units','$vendor','$ppo')";
}else{
$insQ = "UPDATE shelftags SET normal_price = $price, pricePerUnit='$ppo' WHERE upc = '$upc' and id=$id";
}
$insR = $dbc->query($insQ);
?>
<html>
<head>
<script type="text/javascript">
window.close();
</script>
</head>
</html>
Thanks