View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

update multiple records strange toggle effect behaviour

Thread began 5/21/2009 6:12 am by office377308 | Last modified 5/22/2009 12:26 am by office377308 | 1428 views | 4 replies

office377308

update multiple records strange toggle effect behaviour

It seems I can't figure out what's wrong with my setup, at least I am lost.

I want to update a mysql table like

CREATE TABLE IF NOT EXISTS `stories` (
`stories_id` mediumint(6) NOT NULL auto_increment,
`categories_id` mediumint(6) NOT NULL,
`stories_language_id` tinyint(2) NOT NULL,
`stories_header` varchar(250) collate utf8_unicode_ci NOT NULL,
`story` text collate utf8_unicode_ci,
`sort_order` mediumint(6) NOT NULL,
`zuletzt` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`stories_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

OK, it looks simple.

I want to update only the sort order so I create a form with a submit button, provide a table row with a textfield, bind it to the recordset, apply repeat region according to the recordset: Everything works fine until here.

Applying the multiple update behaviour shows a very strange effect:
Since I do not provide a redirect, I let the field "Go to (optional)" empty and let "pass original querystring" unhooked.

If I update a sort field by entering a different number and press the update button, after the page reloads, the old entry is here again. But looking up the database with phpmyadmin shows: Update with the new entry was succesful!

If I hit the update button again without touching the formfield, the new, updated entry shows up in the form but the database entry has the old value again! If I click the button again, the whole game repeats itself. It toggles the form entry / database entry each time I click the update button.

The best thing is still to come.
This is the start of the WA code:
<?php
// WA DataAssist Multiple Updates
if (isset($_POST["aktualisieren"])) // Trigger
{
if (!session_id()) session_start();
$WA_loopedIDField = array("WADA_RepeatID_stories_id");
$WA_connection = $lil;
$WA_table = "stories";
$WA_redirectURL = "";
$WA_keepQueryString = false;
.....
?>

Now, if I replace the lines

$WA_redirectURL = "";
$WA_keepQueryString = false;

with:

$WA_redirectURL = $_SERVER['PHP_SELF'];
$WA_keepQueryString = true;

The "Update Multiple Records" server behaviour disappears from the Server Behaviours panel but the page works like expected.
No toggle effects anymore.

I am sitting for hours now but don't find a solution...
can someone please tell me whats going on here?

PS.:
Also, one should mention that one has to SELECT the unique key column in the Recordset, otherwise this behaviour does not work at all. I first thought it is not necessary because there is this this "automatic bind" message.

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...