Avatar of Dolamite Jenkins
Dolamite Jenkins
Flag for United States of America asked on

deleterow();

I'm trying to loop through the sqlite database to transmit the data to the server ... once the data is transmitted successfully and the server returns "1" I want it to delete the row just transmitted (.deleterow) then next transmit the next row (.next)... but the way I am doing it isn't working

if(jObject.Result == 1)
{ getGroundData.deleteRow();
 getGroundData.next();

Open in new window



var Groundy = function(){
var db = Ti.Database.open('TennisApp');
var getGroundData = db.execute('SELECT user, MatchUID,Ossys, UserID, SetPrKey, Game, Point, Stroke, XCor, YCor FROM GroundStrokeData');
while (getGroundData.isValidRow())
{
     var user = getGroundData.fieldByName('UserID');
     var UserID = getGroundData.fieldByName('UserID');
     var MatchUID = getGroundData.fieldByName('MatchUID'); 
     var Ossys = getGroundData.fieldByName('Ossys');
     var SetPrKey = getGroundData.fieldByName('SetPrKey'); 
     var Game = getGroundData.fieldByName('Game');
     var Point = getGroundData.fieldByName('Point');  
     var Stroke = getGroundData.fieldByName('Stroke'); 
 
     var XCor = getGroundData.fieldByName('XCor');
     var YCor = getGroundData.fieldByName('YCor');
  GroundDtrokeTransmit(user, MatchUID, Ossys, UserID, SetPrKey, Game,  Point, Stroke, XCor, YCor);
 
}
db.execute('DELETE FROM GroundStrokeData');
getGroundData.close();
db.close();
 
};
 
var GroundDtrokeTransmit = function(user, MatchUID, Ossys,  UserID, SetPrKey){ 
var xhr=Titanium.Network.createHTTPClient();    
 xhr.onerror = function(e){ 
 Ti.API.error('groundy Bad Sever =>'+e.error);
};

Open in new window

MySQL ServerJavaScriptDatabases

Avatar of undefined
Last Comment
Aaron Tomosky

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Aaron Tomosky

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy