Im trying to insert some values into the DB inside a concrete5 single page and it's telling me that my syntax is wrong. I'm not sure where the syntax is wrong because i went by what was on their website. My code is Below.
<?php defined('C5_EXECUTE') or die("Access Denied.");
$db = Loader::db();
$quantity = $_POST['quantity'];
$product = $_POST['product'];
$vendor = $_POST['vendor'];
$address = $_POST['address'];
$user = $_POST['userName'];
$costcenter = $_POST['costCenter'];
$index = 0;
foreach($quantity as $info){
$num = mysql_real_escape_string($quantity[$index]);
echo "$num";
echo "</br>";
$item = mysql_real_escape_string($product[$index]);
echo "$item";
echo "</br>";
$company = mysql_real_escape_string($vendor[$index]);
echo "$company";
echo "</br>";
$shipping = mysql_real_escape_string($address[$index]);
echo "$shipping";
echo "</br>";
$person = mysql_real_escape_string($user);
echo "$person";
echo "</br>";
$center = mysql_real_escape_string($costcenter);
echo "$center";
echo "</br>";
$sql = "INSERT INTO Orders (quantity,orderItem,vendor,shippingAddress,userName,costCenter) VALUES $num,$item,$company,$shipping,$person,$center";
$db->Execute($sql);
$index++;
}
?>