Multiple record update not updating database
I have recently purchased the new databridge am trying update a settings form on a settings page. Am not sure if I have set it up correctly, form submits however does not update.
I have recently purchased the new databridge am trying update a settings form on a settings page. Am not sure if I have set it up correctly, form submits however does not update.
It looks like you have a dynamically named index field:
<input id="<?php echo($SiteSettings->getColumnVal("SettingsID")); ?>" name="<?php echo($SiteSettings->getColumnVal("SettingsName")); ?>" type="<?php echo($SiteSettings->getColumnVal("SettingsType")); ?>" value="<?php echo($WAGlobals->getColumnVal("SettingsValue")); ?>" class="form-control control-group" tabindex="<?php echo($SiteSettings->getColumnVal("SettingsWeight")); ?>" title="Please enter a value." required="true">
It shouldn't be... it should just be:
<input id="setting_<?php echo($wa_startindex); ?>" name="setting_<?php echo($wa_startindex); ?>" type="text" value="<?php echo($WAGlobals->getColumnVal("SettingsValue")); ?>" class="form-control control-group" title="Please enter a value." required="true">
Then you don't have a binding set to update that column. You would need to update the code above from:
$UpdateQuery->Table = $MultipleUpdateTable;
$UpdateQuery->addFilter($MultipleUpdateIndexColumn, "=", $MultipleUpdateIndexColumnType, $_POST[$MultipleUpdateIdentifier."_".$MultipleUpdateCount]);
to:
$UpdateQuery->Table = $MultipleUpdateTable;
$UpdateQuery->bindColumn("SettingsValue", "s", "".((isset($_POST["setting"."_".$MultipleUpdateCount]))?$_POST["setting"."_".$MultipleUpdateCount]:"") ."", "WA_BLANK");
$UpdateQuery->addFilter($MultipleUpdateIndexColumn, "=", $MultipleUpdateIndexColumnType, $_POST[$MultipleUpdateIdentifier."_".$MultipleUpdateCount]);
Hi Ray I made those changes however it is still not working
This looks like it would work to me. I'd have to debug it live. Can I get a url with login information to test and FTP access? Otherwise I could help you debug it in a screen sharing session.
I figured it out Ray, I ran the multiple update again with the form corrected removing what you suggested. I appreciate the help as always.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.