Autofill Not Working

Byrd

Member
I keep getting Parserror when the autofill runs. Not sure why.

Link is Maintain Location (Form = Location)
Purchased ZIPCode table and uploaded it to MySQL DB.

What should happen:
Enter Zip code into field, City and State are pulled from ZIPCode table.

I have this same set up working on another site, but it's not working on this site. Cannot figure out why. I've cleared cache and everything... I'll add site info into my sites section.
 
Also, while you are looking at this issue, can you please look at the DVL list element SalesRep2 ? It's a databasejoin and I'm trying to use the Concat for label for Lastname, Firstname. I set it up exactly as shown in example, but it's not working on front end. (Create DVL link on Front End.)
 
You hadn't set a "Primary Key" on your ZIP list, so Fabrik didn't know what to use as the PK to look the matching ZIP up with for the autofill. I edited the list settings, and designated the ZIP itself as the PK. You should check in phpMyAdmin (or whatever) and make sure it is set as the primary key in the underlying table, and that there is an index on that column. Fabrik should have done that when I set it in the List, but best check.

For the CONCAT label, you had two issues ... you had single quotes around your field names, like 'mytable.field' ... in MySQL, normal quotes are for data. Table and field names use backticks (or nothing at all, as long as the names don't conflict with MySQL keywords). So `mytable`.`field` or just mytable.field.

And ... when specifying the table name, as per the tooltip, don't use the actual table name, use the placeholder {thistable}. So {thistable}.first_name, etc. That's because it's possible that when Fabrik creates the query to select all your data, we may need to use an "alias" for the joined table, for example if you have more than one join to one table. So it could wind up being "SELECT yourtable AS yourtable_1" ... so using yourtable.field will error out, as it doesn't match the alias in use ... and you/we don't know in advance what that alias will be. So we will replace {thistable} with whatever alias we are using for your joined table at run time.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top