DataTabels to MySql

DataTabels to MySql

kippikippi Posts: 3Questions: 0Answers: 0
edited May 2009 in General
Hi,

I need away to pass the updated table to mysql. One way I was looking at doing this was:

$('#form').submit( function() {
var sData = $('input', oTable.fnGetNodes()).serialize();
var nData = $('input', oTable.fnGetNodes()).serialize();
alert( "The following data would have been submitted to the server: \n\n"+nData );
$.post("saveupdate.php", { data : nData });
});

But this is not correctly posting the table.

How have other people done this?

Many Thanks

Chris.

Replies

  • allanallan Posts: 63,578Questions: 1Answers: 10,483 Site admin
    What is nData (which is a string in this case not a node if you are going my Hungarian notation :-) ) when the alert() fires?

    Note that the jQuery documentation says the $.post() expects data to be a key/value pair, rather than a string ( http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype and http://docs.jquery.com/Ajax/serialize ).

    A quick look at the jQuery documentation suggests that you might be able to use serializeArray(). If this doesn't work, then this is probably one for the jQuery discussion list rather than a specific DataTables question.

    Regards,
    Allan
This discussion has been closed.