Change this
$input = "INSERT INTO $dbtable VALUES('Primary_Key', 'curdate', 'description', 'partno', 'serialno', 'quantused', 'usedfor', 'areaofwork', 'initials', 'comments')
VALUES(NULL, $curdate, $description, $partno, $serialno, $quantused, $usedfor, $areaofwork, $initials, $comments);";
to this format
$input = "INSERT INTO $dbtable (Primary_Key, curdate, description, partno, serialno, quantused, usedfor, areaofwork, nitials, comments)
VALUES('NULL', '$curdate', '$description', '$partno', '$serialno', '$quantused', '$usedfor', '$areaofwork', '$initials', '$comments')";
That usually solves this syntax error.