IF YOU WANT TO SAVE HTML OF EACH ROW DO:
Use JQuery.
var rowsArray = {};
var i = 0;
$('#theTable tr').each(function({
rowsArray[i] = $(this).html(); // if you want to save the htmls of each row
i++;
});
then use ajax to post this data
$.ajax({
type: 'post',
url: URL_TO_UR_SCRIPT,
data: { myarray : rowsArray },
success: function(result) {
//ur success handler OPTIONAL
}
});
In PHP side you do:
$array = isset($_POST['myarray']) ? $_POST['myarray'] : false;
if ($array) {
$array = serialize($array);
//UPDATE YOUR DATABASE WITH THIS SERIALIZED ARRAY
}
you cant save php array into database therefore you need to serialize it and when you retrieve it from DB use unserialize()
IF you meant that you wanted to save the input and text area values then you need to set the names for each of the element and then access them in your script using $_POST.
$array = array;
foreach($_POST as $key => $value) {
//sanitize your input here
$array[$key] = $value;
}
$serialized = serialize($array);
//save serialized array in your DB
NOTE/HINT: FYI do not use html table to lay out the form elements. Tables should be used for data representation. You could easily do samething using divs and css