Weird Error - Cannot see what I'm doing wrong...
Posted: Tue May 13, 2008 11:23 pm
I have a PHP form that does several things:
1. Drop Down List
2. Radio Button
3. Depending on your selection from the DropDown List, an Insert of the data that matches that row in the lookup table will INSERT that data into another table.
When I ran each section separately it worked... but when I put it all together I get the following error:
Parse error: parse error in /var/www/htdocs/sna/batch3.php on line 27
Here is the code in question:
<?php
$ModelType = $_POST[‘ModelType’];
$Qty = $_POST[‘Qty’];
$OEMSku = $_POST[‘OEMSku’];
$Service = $_POST[‘Service’];
$con = mysql_connect("localhost","root","c0d3r3d!");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("snalogdata", $con);$sql="INSERT INTO snabatch (ModelType, OEMModel, ManfCode, $Qty, OEMSku, $Service)
SELECT * from 'ModelLookup' WHERE OEMSku = '$OEMSku';if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";mysql_close($sql,$con)
?>
The echo "1 record added";mysql_close($sql,$con) :Line is line 27 in question... but I cannot see where this is the problem area... it has to be somewhere else, but I have been looking at the code for so long it all looks right to me...
Any ideas would be great.
Texman
1. Drop Down List
2. Radio Button
3. Depending on your selection from the DropDown List, an Insert of the data that matches that row in the lookup table will INSERT that data into another table.
When I ran each section separately it worked... but when I put it all together I get the following error:
Parse error: parse error in /var/www/htdocs/sna/batch3.php on line 27
Here is the code in question:
<?php
$ModelType = $_POST[‘ModelType’];
$Qty = $_POST[‘Qty’];
$OEMSku = $_POST[‘OEMSku’];
$Service = $_POST[‘Service’];
$con = mysql_connect("localhost","root","c0d3r3d!");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("snalogdata", $con);$sql="INSERT INTO snabatch (ModelType, OEMModel, ManfCode, $Qty, OEMSku, $Service)
SELECT * from 'ModelLookup' WHERE OEMSku = '$OEMSku';if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";mysql_close($sql,$con)
?>
The echo "1 record added";mysql_close($sql,$con) :Line is line 27 in question... but I cannot see where this is the problem area... it has to be somewhere else, but I have been looking at the code for so long it all looks right to me...
Any ideas would be great.
Texman