My form has master-detail data in it. Every master record has 9 detail
records.
When I store the detail information I use ajax.request in a loop to
call it 9 times to add the detail records to mysql database.
However, it seems that the order in which the new records are added is
not the same as the order in which they were called.

This is how my save function looks like:
  function save()
  {
    for(var i=1;i<=9;i++)
    {
      new Ajax.Request('insert.php',
                        {
                          method:'get',
                          parameters:
                          {
                            /* a lot of params*/,
                            preventCache: new Date().getMilliseconds()
                          },
                          onSuccess: function(transport)
                          {
                            var data = transport.responseText;
                            alert(data);
                          },
                          onFailure: function()
                          {
                            alert('something went wrong...');
                          }
                        }
                      );
    }
  }

The insert.php executes the insert statement with the correct params.
Is there a way to use something like a transaction? Or do I need to
add an extra field in the table to determine the order?

Zjoske.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to