title: Insert data into mysql - ios
body: <p>I would like to store 4 values in my database.
  longitude,latitude phone number and timestamp.</p>
  
  <p>I got it al figured out how to store them locally with the NSLOG,</p>
  
  <p>But i want to send it to my MySQL database.</p>
  
  <p>Does somebody have some tutorials or want to help me out here?</p>
  
  <p>I need this badly,</p>
  
  <p>Your help would be appreciated.</p>
  
  <p>Greets</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Here's some code i need to store in my database</p>
  
  <pre><code>    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:&amp;error];
  
  if (!error &amp;&amp; ([result isEqualToString:@"OK"])) {
      // everything went well
  }
  </code></pre>
  
  <p>And i need to store the phone number from a textfield, longitude, latitude &amp; timestamp.</p>
  
  <p>Greets(again)</p>