데이터베이스에 4 개의 값을 저장하고 싶습니다. 경도, 위도 전화 번호 및 타임 스탬프. 데이터를 mysql-ios에 삽입하십시오.
나는 그것을 알이의 NSLOG 로컬로을 저장할하지만 난 내 MySQL 데이터베이스에 보내려고하는 방법을 알아 냈 얻었다.
누군가 튜토리얼을 가지고 있거나 나를 도와주고 싶습니까?
나는이 심하게
당신의 도움을 주시면 감사하겠습니다해야합니다.
는
여기 UPDATE
내가 내 데이터베이스
resultsLabel.text = [NSString stringWithFormat:@"(%@) %@ Location %.06f %.06f %@", ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) ? @"bg" : @"fg", resultsLabel.tag == 0 ? @"gps:" : @"sig" , newLocation.coordinate.latitude, newLocation.coordinate.longitude, [formatter stringFromDate:newLocation.timestamp]];
LocationTestAppDelegate * appDelegate = (LocationTestAppDelegate *)[UIApplication sharedApplication].delegate;
[appDelegate log:resultsLabel.text];
NSString* encodedValue = [newLocation.coordinate.latitude
stringByAddingPercentEscapesUsingEncoding:
NSASCIIStringEncoding];
//construct an URL for your script, containing the encoded text for parameter value
NSURL* url = [NSURL urlWithString:
[NSString stringWithFormat:
@"http://yourdomain.com/locatie.php?id=%@",
encodedValue]];
NSError* error = nil;
//send the request synchronously, store the response in result
NSString* result = [NSString stringWithContentsOfURL:url
encoding:NSUTF8StringEncoding
error:&error];
if (!error && ([result isEqualToString:@"OK"])) {
// everything went well
}
에 저장해야 할 몇 가지 코드의 접견 그리고 난은 텍스트 필드, 경도, 위도 & 타임 스탬프에서 전화 번호를 저장해야 .
인사말 (다시)
http://whathaveyoutried.com? – Luke
SQLite를 시도했지만 지금까지는 작동하지 않습니다 .. –
코드를 게시하면 사람이 수정하고 도움을 줄 수 있습니다. ;) – Luke