close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

multiple update missing 2 fields

Thread began 6/11/2022 7:55 am by Sweens | Last modified 6/14/2022 9:22 am by Ray Borduin | 63 views | 5 replies |

Sweens

multiple update missing 2 fields

Hi Ray

I have quite a complicated page (attached). There are 3 optional select menus on the form - the dropdowns all work.

However, only the data entered into the first (sel1) is updated in the database - the other two are ignored.

The update code at the top of the page is identical, bar the field names:

$UpdateQuery->bindColumn("fr_sel1", "s", "".((isset($_POST["sel1"."_".$MultipleUpdateCount]))?$_POST["sel1"."_".$MultipleUpdateCount]:"") ."", "WA_NULL");
$UpdateQuery->bindColumn("fr_sel2", "s", "".((isset($_POST["sel2"."_".$MultipleUpdateCount]))?$_POST["sel2"."_".$MultipleUpdateCount]:"") ."", "WA_NULL");
$UpdateQuery->bindColumn("fr_sel3", "s", "".((isset($_POST["sel3"."_".$MultipleUpdateCount]))?$_POST["sel3"."_".$MultipleUpdateCount]:"") ."", "WA_NULL");


and ditto for the form fields themselves.

Anything obvious?

Many thanks
Chris

Sign in to reply to this post

Sweens

I've looked at the source code of the page, and the <?php echo($wa_startindex); ?> value is missing from sel2 and sel3 field names and id (which should be sel2_<?php echo($wa_startindex); ?> and sel3_<?php echo($wa_startindex); ?>)

Cheers

Chris

Sign in to reply to this post

Sweens

Hi Ray

I appear to have solved it - but would like confirmation, if you could.

Thinking that it's the wa_startindex that's causing the problem, I have renamed the second repeat region of select menu choices to wa_startindex2 and the third instance to wa_startindex3

Fingers crossed!

Cheers

Chris

Sign in to reply to this post

Ray BorduinWebAssist

That doesn't sound right. The missing values in the names and IDs sounds like it should have fixed it. Renaming other variables shouldn't be necessary.

Sign in to reply to this post
Did this help? Tips are appreciated...

Sweens

Hi Ray

The field name (sel1) has the original repeat region, but the select options are renamed e.g. $wa_startindex1 as below. It works!

<select class="browser-default custom-select" name="sel1_<?php echo($wa_startindex); ?>" id="sel1_<?php echo($wa_startindex); ?>">
<option value="" disabled <?php if (!(strcmp("", ($rsForm->getColumnVal("fr_sel1"))))) {echo "selected=\"selected\"";} ?>>Choose option</option>
<?php
$wa_startindex1 = 0;
while(!$rsSelects->atEnd()) {
$wa_startindex1 = $rsSelects->Index;
?>
<?php /*START*/ if ($rsSelects->getColumnVal("fs_sel_no")=="1"){ ?>
<option value="<?php echo($rsSelects->getColumnVal("fs_id")); ?>"<?php if (!(strcmp($rsSelects->getColumnVal("fs_id"), ($rsForm->getColumnVal("fr_sel1"))))) {echo "selected=\"selected\"";} ?>><?php echo($rsSelects->getColumnVal("fs_sel")); ?></option><?php } /*END*/ ?>
<?php
$rsSelects->moveNext();
}
$rsSelects->moveFirst(); //return RS to first record
unset($wa_startindex1);
unset($wa_repeatcount);
?>
</select>
</td><?php } /*END*/ ?>

Cheers

Chris

Sign in to reply to this post

Ray BorduinWebAssist

It should work the same if you don't rename the variable. I don't think that is a necessary step. Maybe though... I guess it depends on how everything is nested.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...