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.