I am trying to develop an android mobile application using the PhoneGap framework, and I want to synchronize my table of local database(of my phone) to the server database.
this is my code, but this code allow me to send only one line of table how can i send all line of table.
$.ajax({
type: 'POST',
data: col1+'&lid='+col2,
url: 'http://your-domain.com/comments/save.php',
success: function(data){
console.log(data);
alert('Your data was successfully added');
},
error: function(){
console.log(data);
alert('There was an error adding your data');
}
});
sorry for my miss understoods…
If you are using phonegap i guess you are using the Storage feature: http://docs.phonegap.com/en/2.2.0/cordova_storage_storage.md.html#Storage
folowing one of theirs examples, you can do something like:
other option is to send a simple array…
hope it helps!