Forums

Syntax Error

cgoodwin 07 Jul, 2009
Hello -
I've found a few posts by people with a similar issue, but I've been unable to fix this problem. Tonight, I recreated the table for one of my forms and suddenly am getting this error: "Parse error: syntax error, unexpected '-', expecting ',' or ';' in ...public_html/components/com_chronocontact/chronocontact.php(52) : eval()'d code on line 17"

I've checked both my form HTML and the chronocontact.php code and cannot find an extraneous dash. Is there somewhere else I should look? Another post said it might be in the DB Connections code, but I don't know where to find that. Any help would be appreciated. If you would like to look at any snippets of the code, let me know what you'd like and I'll post it here.

Thank you!
-Casey
GreyHead 07 Jul, 2009
Hi Casey,

The problem is the dashes in some of the field names e.g.
<input type="text" maxlength="100" size="50" name="summer-address"/>
These trip up the SQL unless they are correctly quoted and ChronoForms doesn't always get this quite correct. They are also bad html so the best thing to do is to replace them with underscores name="summer_address" - you'll also need to rename the columns in the database table to match (or drop and re-create the table).

Bob
cgoodwin 07 Jul, 2009
Well, I feel dumb. I thought I changed those last night, but it didn't help, so I changed them back. In trying it again, I realized the changes didn't stick (because they didn't stick this time). Got it to work. Thanks!
This topic is locked and no more replies can be posted.