This topic is locked
[SOLVED]

 Incorrect syntax near ",

8/10/2014 11:19:21 AM
PHPRunner General questions
G
g_parry author

I'd appreciate a fresh pair of eyes on this code - I'm getting ann error message Incorrect syntax near ", but I've looked and looked and really can't find it

Any help PLEASE <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=22479&image=1&table=forumtopics' class='bbc_emoticon' alt=':rolleyes:' />



global $conn;

$strSQLInsert = "INSERT INTO tblTestPeople

(

psnPersonID,

psnYear,

psnType,

psnIndexName,

psnTitle,

psnForename,

psnInitials,

psnSurname,

psnUsername,

psnDepartment,

psnTelephone,

psnEmail,

psnFTE,

psnLeavingDate,

psnSiteResident,

psnPostCode,

psnDD,

psnDDAuthorised,

psnSalaryFrequency,

psnDeductionToday,

psnSecureName,

psnNonRegistered,

psnFlag,

psnModified)

VALUES

(

".$values["apnPersonID"].",

'".$values["apnYear"]."',

'".$values["apnType"]."',

'".$values["apnIndexName"]."',

'".$values["apnTitle"]."',

'".$values["apnForename"]."',

'".$values["apnInitials"]."'.

'".$values["vclSurname"]."',

'".$values["apnUsername"]."',

'".$values["apnDepatment"]."',

'".$values["apnTelephone"]."',

'".$values["apnEmail"]."',

'".$values["apnFTE"]."',

'".$values["apnLeavingDate"]."',

'".$values["apnSiteResident"]."',

'".$values["apnPostCode"]."',

'".$values["apnDD"]."',

'".$values["apnDDAuthorised"]."',

'".$values["apnSalaryFrequency"]."',

'".$values["apnDeductionToday"]."',

'".$values["apnSecureName"]."',

'".$values["apnNonRegistered"]."',

'".$values["apnFlag"]."',

'".$values["apnModified"]."')";

db_exec($strSQLInsert,$conn);

Sergey Kornilov admin 8/12/2014

Instead of executing this SQL query print it on the web page and then run it manually against your database to find the syntax error.

$strSQLInsert = ...

echo $strSQLInsert;

exit();

//db_exec($strSQLInsert,$conn);