Hi Guys
My first post on the forum.
I am new to PHP and and having some problems with a HTML form and PHP and hope someone could help me.
I have this form on a website
<form action="wwinsert.php" method="post">
<fieldset>
<legend>Weekly Work</legend>
<p><label class="lab1" for="StoreNumber">Store:</label><input type="text" name="StoreNumber" class="textbox-300"></p>
<p><label class="lab1" for="WeekEndingDate">Week Ending:</label><input type="date" name="WeekEndingDate" class="textbox-300"></p>
<p><label class="lab1" for="ActualSales">Actual Sales:</label><input type="number" step="any" step="any" name="ActualSales" class="textbox-300"></p>
<p><label class="lab1" for="SalesonLastYear">Sales% on Last Year:</label><input type="number" step="any" step="any" name="SalesonLastYear" class="textbox-300"></p>
<p><label class="lab1" for="ProjectedSales">Projected Sales:</label><input type="number" step="any" step="any" name="ProjectedSales" class="textbox-300"></p>
<p><label class="lab1" for="SalesVsProjections">Sales% Vs Projections:</label><input type="number" step="any" step="any" name="SalesVsProjections" class="textbox-300"></p>
<p><label class="lab1" for="GuestCount">Guest Count:</label><input type="number" step="any" step="any" name="GuestCount" class="textbox-300"></p>
<p><label class="lab1" for="GuestCountVsLastYear">Guest Count % Vs Last Year:</label><input type="number" step="any" name="GuestCountVsLastYear" class="textbox-300"></p>
<p><label class="lab1" for="ActualLabour">Actual Labour:</label><input type="number" step="any" name="ActualLabour" class="textbox-300"></p>
<p><label class="lab1" for="ProjectedLabour">Projected Labour:</label><input type="number" step="any" name="ProjectedLabour" class="textbox-300"></p>
<p><label class="lab1" for="BaseFoodCost">Base Food Cost:</label><input type="number" step="any" name="BaseFoodCost" class="textbox-300"></p>
<p><label class="lab1" for="ActualFoodCost">Actual Food Cost:</label><input type="number" step="any" name="ActualFoodCost" class="textbox-300"></p>
<p><label class="lab1" for="FullWaste">Full Waste %:</label><input type="number" step="any" name="FullWaste" class="textbox-300"></p>
<p><label class="lab1" for="RawWaste">Raw Waste %:</label><input type="number" step="any" name="RawWaste" class="textbox-300"></p>
<p><label class="lab1" for="EMeals">E-Meals %:</label><input type="number" step="any" name="EMeals" class="textbox-300"></p>
<p><label class="lab1" for="Promo">Promo %:</label><input type="number" step="any" name="Promo" class="textbox-300"></p>
<p><label class="lab1" for="NonRecipe">Non Recipe %:</label><input type="number" step="any" name="NonRecipe" class="textbox-300"></p>
<p><label class="lab1" for="Deviation">Deviation %:</label><input type="number" step="any" name="Deviation" class="textbox-300"></p>
<p><label class="lab1" for="FryYield">Fry Yield:</label><input type="number" step="any" name="FryYeild" class="textbox-300"></p>
<p><label class="lab1" for="LettuceYield">Lettuce Yield:</label><input type="number" step="any" name="LettuceYeild" class="textbox-300"></p>
<p><label class="lab1" for="SundaeYield">Sundae Yield:</label><input type="number" step="any" name="SundaeYeild" class="textbox-300"></p>
<p><label class="lab1" for="ShakeYield">Shake Yield:</label><input type="number" step="any" name="ShakeYeild" class="textbox-300"></p>
<p><label class="lab1" for="Cash">Cash +/-:</label><input type="number" step="any" name="Cash" class="textbox-300"></p>
<p><label class="lab1" for="NumberofTotalRefunds">Number of Total Refunds:</label><input type="number" step="any" name="NumberOfTotalRefunds" class="textbox-300"></p>
<p><label class="lab1" for="RefundsTotal">Refunds Total:</label><input type="number" step="any" name="RefundsTotal" class="textbox-300"></p>
<p><label class="lab1" for="TREDSBeforeTotal">T/REDS Before Total:</label><input type="number" step="any" name="TRedsBeforeTotal" class="textbox-300"></p>
<p><label class="lab1" for="TREDSBeforeTotalValue">T/REDS Before Total Pounds:</label><input type="number" step="any" name="TRedsBeforeTotalValue" class="textbox-300"></p>
<p><label class="lab1" for="WeeklykWusage">Weekly kW usage:</label><input type="number" step="any" name="WeeklykWUsage" class="textbox-300"></p>
<p><label class="lab1" for="EnergyCost">Energy Cost:</label><input type="number" step="any" name="EnergyCost" class="textbox-300"></p>
<p><label class="lab1" for="TrainingAuditDate">Training Audit Date:</label><input type="Date" name="TrainingAuditDate" class="textbox-300"></p>
<p><label class="lab1" for="TrainingAuditScore">Training Audit Score:</label><input type="number" step="any" name="TrainingAuditScore" class="textbox-300"></p>
<p><label class="lab2" for="PLProjectedSales">P&L Projected Sales:</label><input type="number" step="any" name="PLProjectedSales" class="textbox-300"></p>
<p><label class="lab2" for="PLProjectedLabour">P&L Projected Labour:</label><input type="number" step="any" name="PLProjectedLabour" class="textbox-300"></p>
<p><label class="lab2" for="PLProjectedFoodCost">P&L Projected Food Cost:</label><input type="number" step="any" name="PLProjectedFoodCost" class="textbox-300"></p>
<p><label class="lab3" for="MonthlyActualSales">Monthly Actual Sales:</label><input type="number" step="any" name="MonthlyActualSales" class="textbox-300"></p>
<p><label class="lab3" for="MonthlySalesonLastYear">Monthly Sales% on Last Year:</label><input type="number" step="any" name="MonthlySalesOnLastYear" class="textbox-300"></p>
<p><label class="lab3" for="MonthlyActualLabour">Monthly Actual Labour:</label><input type="number" step="any" name="MonthlyActualLabour" class="textbox-300"></p>
<p><label class="lab3" for="MonthlyBaseFoodCost">Monthly Base Food Cost:</label><input type="number" step="any" name="MonthlyBaseFoodCost" class="textbox-300"></p>
<p><label class="lab3" for="MonthlyActualFoodCost">Monthly Actual Food Cost:</label><input type="number" step="any" name="MonthlyActualFoodCost" class="textbox-300"></p>
<p><label class="lab3" for="MonthlyCash">Monthly Cash +/-:</label><input type="number" step="any" name="MonthlyCash" class="textbox-300"></p>
<p><label class="lab3" for="HighestBreakfastHour">Highest Breakfast Hour:</label><input type="number" step="any" name="HighestBreakfastHour" class="textbox-300"></p>
<p><label class="lab3" for="HighestHour">Highest Hour:</label><input type="number" step="any" name="HighestBreakfastShift" class="textbox-300"></p>
<p><label class="lab3" for="RecordCars">Record Cars:</label><input type="number" step="any" name="HighestHour" class="textbox-300"></p>
<p><label class="lab3" for="DriveThru">Drive Thru %:</label><input type="number" step="any" name="DriveThru" class="textbox-300"></p>
<input type="submit" value="Submit">
</fieldset>
</form>
that links to this PHP sheet code
<?php
$con=mysql_connect(My login details here);
$sql="INSERT INTO weeklywork (StoreNumber, WeekEndingDate, ActualSales, SalesonLastYear, ProjectedSales, SalesVsProjections, GuestCount, GuestCountVsLastYear, ActualLabour, ProjectedLabour, BaseFoodCost, ActualFoodCost, FullWaste, RawWaste, EMeals, Promo, NonRecipe, Deviation, FryYeild, LettuceYeild, SundaeYeild, ShakeYeild, Cash, NumberOfTotalRefunds, RefundsTotal, TRedsBeforeTotal, TRedsBeforeTotalValue, WeeklykWUsage, EnergyCost, TrainingAuditDate, TrainingAuditScore, PLProjectedSales, PLProjectedLabour, PLProjectedFoodCost, MonthlyActualSales, MonthlySalesOnLastYear, MonthlyActualLabour, MonthlyBaseFoodCost, MonthlyActualFoodCost, MonthlyCash, HighestBreakfastHour, HighestBreakfastShift, HighestHour, RecordCarsThisMonth, DriveThru)
VALUES
('$_POST["StoreNumber"]','$_POST["WeekEndingDate"]',$_POST['ActualSales'],$_POST['SalesonLastYear'],$_POST['ProjectedSales'],$_POST['SalesVsProjections'],$_POST['GuestCount'],$_POST['GuestCountVsLastYear'],$_POST['ActualLabour'],$_POST['ProjectedLabour'],$_POST['BaseFoodCost'],$_POST['ActualFoodCost'],$_POST['FullWaste'],$_POST['RawWaste'],$_POST['EMeals'],$_POST['Promo'],$_POST['NonRecipe'],$_POST['Deviation'],$_POST['FryYeild'],$_POST['LettuceYeild'],$_POST['SundaeYeild'],$_POST['ShakeYeild'],$_POST['Cash'],$_POST['NumberOfTotalRefunds'],$_POST['RefundsTotal'],$_POST['TRedsBeforeTotal'],$_POST['TRedsBeforeTotalValue'],$_POST['WeeklykWUsage'],$_POST['EnergyCost'],'$_POST["TrainingAuditDate"]',$_POST['TrainingAuditScore'],$_POST['PLProjectedSales'],$_POST['PLProjectedLabour'],$_POST['PLProjectedFoodCost'],$_POST['MonthlyActualSales'],$_POST['MonthlySalesOnLastYear'],$_POST['MonthlyActualLabour'],$_POST['MonthlyBaseFoodCost'],$_POST['MonthlyActualFoodCost'],$_POST['MonthlyCash'],$_POST['HighestBreakfastHour'],$_POST['HighestBreakfastShift'],$_POST['HighestHour'],$_POST['RecordCarsThisMonth'],$_POST['DriveThru'])";
if (mysql_query($con,$sql))
{
die('Error: ' . mysql_error($con));
}
echo "1 record added";
?>
when I fill in the form I am getting this error:- Parse error: syntax error, unexpected '"', expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\toolbox\wwinsert.php on line 9
can anyone help me please.
in my DB Store number is type "Varchar" and weekendingdate and audit "date" are type date the reset are "decimal" and "int"