Why do I get an error with:
$query = "INSERT INTO ".$Table." (UserID, RecID, Dirty, Deleted, ".$Fields.") VALUES (".$UserID.", ".$RecID.", ".$Dirty.", ".$Deleted.", ".$Data.")";
but not (when I add extra quotes around $Data):
$query = "INSERT INTO ".$Table." (UserID, RecID, Dirty, Deleted, ".$Fields.") VALUES (".$UserID.", ".$RecID.", ".$Dirty.", ".$Deleted.", '".$Data."')";
I would like to pass the fields in $Fields (ie. $Fields = "Fld1, Fld2, Fld3")
And pass the data in $Data (ie. $Data = "Field1Data, Field2Data, Field3Data")
I can pass the info in $Fields, but I can't figure out how to pass the same sting to $Data.
Can anyone help with this?
Thanks
Greg