I’m looking to write the UPDATE RECORD query sent to the server based on which inputs the user has changed. For instance in a php mysql or Maria db project
Standard Wappler API UPDATE QUERY is something like this –
UPDATE story_data_ukd
SET collection_id
=’[value-1]’,story_ID
=’[value-2]’,story_collector
=’[value-3]’,datum
=’[value-4]’,art_interview
=’[value-5]’,form_interview
=’[value-6]’,story
=’[value-7]’,gefuehl_1
=’[value-8]’,werte_1
=’[value-9]’,personen_1
=’[value-10]’,triangle_einfluss
=’[value-11]’,slider_anteil
=’[value-12]’,slider_einfluss
=’[value-13]’,skala_zukunft
=’[value-14]’,team
=’[value-15]’,umfang_1
=’[value-16]’,geschlecht
=’[value-17]’,new_datum
=’[value-18]’ WHERE collection_id
= {{$_POST.collection_id}}
UPDATE and SET queries must return all of the existing data, too, whether changed or unchanged, when it is the form update user who will choose which inputs to affect or leave alone.
Even if the user decides only to change values in one input data field the Submit Change Query will have to pass along the retrieved (existing) unchanged values for all of these fields, too.
I would like to send an update query that only SETs the inputs actually changed by the user.
As in –
UPDATE story_data_ukd
SET team
=’[value-15] WHERE collection_id
= {{$_POST.collection_id}}
The javascript related Wappler component on the Update Record form page determines which inputs were selected and modified and dynamically submits the update and set query required to update only changed inputs. Such as –
UPDATE story_data_ukd
SET story_ID
=’[value-2]’,form_interview
=’[value-6]’ WHERE collection_id
= {{$_POST.collection_id}}
Have any Wappler developers written their update form pages to refine their Update queries with the dynamic browser action components provided by Wappler?
Thank you for helpful replies!
Last updated: