Update Query needs to close gaps/holes.
I pointed this one out a year or more ago along with the suggestion to add WHERE clause on the MYSQL Settings for security reasons(that was helpful!). But this second idea seemed to go into the void.
This one I feel is needed to make the UPDATE queries complete. The CFF plugin already does this, but I'd rather the Form Maker folks give it a try. CFF = Calculated Fields Form.
The target is to allow the user to update what fields they only need to and not the entire form. The gaps are when a user wants to update only so many fields in a table - the form can blank out fields in the MYSQL Database. This happens because the form is blank and the user could place an email ID let's say but has no need to remember all the values of the rest of the columns for that record. Upon submission, the user can wipe out all the other fields since the form has no intelligence to know what is it writing. (for example, it thinks that any blank field is supposed to be blank). I tested this before I did queries a while back and was like OMG. If the user updates that email field and places the new value there, but the user record in the database that is being written back to has Name, Address, Phone, etc. Then those fields get set to blank.
The alternative is to have a user go into the Form's settings (not a good idea) and into the MYSQL settings (even worse idea) to click what fields to update in the update query. Not to mention this may need to change each time they need to edit any record. They may want to update Phone on something else, etc.
What CFF does is to pull in the fields right from the database using a setup the designer sets for the form and in a PHP template, it matches named fields in the form to the table fields. This is not the best as it takes time to load and you need JS to try and show when it is finally loaded.
What I thought is to either have a checkbox or some object the user can check or uncheck so the form will update the MYSQL settings under update. The form can default to no fields to update as a precaution, then the user entering values will take off the checkmark. Or the user would have to do it as they went. Or do what CFF does, but that is not efficient.
This is why I have to marry WPDATATABLES on the same page as Form Maker so the user can see what fields are populated. When they need to enter data though, I have to use CFF. Either way, Form Maker is missing a key function for UPDATE queries. I may end up going with tables and not forms in the end but wanted to see if you could "fix" this. Thanks!
Please sign in to leave a comment.
Comments
2 comments