Connection To Database issue

Indaba 28 May, 2010
I have the latest version of the component just installed today and everything was working fine. The form was pulling through and when info was submitted it validated and all that and an email came through immediately.

The issues comes when I connect to a database. I worked through the tutorial provided in the downloads section but what happens is that as soon as I change the setting to "Yes" under the DB Connection tab within my form settings I get the following error on the screen.

Parse error: syntax error, unexpected '$', expecting T_VARIABLE in /home/nwsarcoma/nwsarcoma.org/components/com_chronocontact/chronocontact.php(53) : eval()'d code on line 21

Fatal error: Call to a member function bind() on a non-object in /home/nwsarcoma/nwsarcoma.org/components/com_chronocontact/libraries/customcode.php(71) : eval()'d code on line 13



As soon as as I change the DB connection option back to "No" the forms goes back to working just fine. Can anyone help me figure out what the issue is? Thank you in advance.
nml375 28 May, 2010
Hi,
Most likely, you've got a space or dash in one or more of the database table fields. You'll have to remove these, or replace them with _. You'll also have to re-do the DB Connection setup once the tables are updated, and finally you'll have to change the form field names to match the new database table fieldnames.

/Fredrik
Indaba 01 Jun, 2010
Thank you for the prompt reply. I will give this a try and let you know if it fixes things.
Indaba 01 Jun, 2010
When I checked the field names are all lowercase with no spaces, except for the ones created by chronoforms and those have the underscore in place. So I am not seeing how it is a space or dash issues at this point.

I have attached an image of the fields so you can see what I am looking at. Could it be the "34" in the field 4th form the bottom?

Any additional feedback would be greatly appreciated.

Forums image 1
nml375 01 Jun, 2010
Hi,
The error lies in the 34hourevent field. PHP requires that the first character of a variable name is [a-zA-Z], thus no digits. The rest of the variable name may contain digits however. The same applies to form field names in the HTML specifications.

/Fredrik
Indaba 01 Jun, 2010
Makes sense. I will try it out and repost here as to the outcome. Thank you again for the prompt response.
This topic is locked and no more replies can be posted.