I am stumped with this syntax error (below):
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
'desc, barkDesc, flowerDesc, foliageDesc, fruitDesc, type, cat, height, spread, l'
at line 1
What throws me off is the number 1 after spread like so (height, spread, 1).
Below is a php print of the INSERT INTO statement which looks great to me.
INSERT INTO plants
(botanicalName, commonName, landscapeUses, desc, barkDesc, flowerDesc, foliageDesc, fruitDesc, type, cat, height, spread, lightReq, soil, growth, trimming, fert, otherMaint)
VALUES
('Botanical name', 'Common Name', 'Accent, Edge, Groundcover', 'This is some text description text.', 'bark', 'flower', 'foliage', 'fruit', 'Perennial', '', '18 inches', '18 inches', 'full sun', 'well drained', 'medium', 'trimming', 'fertilization', 'other maintenance')
And without further ado, MY PHP code
$sql2 = "INSERT INTO plants
(botanicalName, commonName, landscapeUses, desc, barkDesc, flowerDesc,
foliageDesc, fruitDesc, type, cat, height, spread, lightReq, soil, growth,
trimming, fert, otherMaint)
VALUES ('$botanicalName', '$commonName', '$usesString', '$desc', '$barkDesc',
'$flowerDesc', '$foliageDesc', '$fruitDesc', '$type', '$cat', '$height', '$spread', '$lightReq', '$soil', '$growth', '$trimming', '$fert', '$otherMaint')";
$result2 = mysql_query($sql2) or die(mysql_error());
$plantID = mysql_insert_id();
header("location: plantdetail.php?plantID=$plantID");