title: XCode inserting data via iphone into mysql database response
body: <p>I have been looking online and doing research on different ways to connect to webpages (.php file in my case) to insert data into mysql database. My code works and successfully inserts data I type in to the field, however, I would like to be able to notify the user that the name has successfully been inserted into the database with no errors, and if there is an error spit out an error. Here is the code that is working (it inserts whatever name user types into my database):</p>
  
  <pre><code>- (IBAction)addButton:(id)sender {
  
  NSString *name = self.MYSQLfield.text;
  NSLog(@"%@", name);
  // create string contains url address for php file, the file name is insert.php, it receives parameter :name
  NSString *strURL = [NSString stringWithFormat:@"http://twochicken.com:8080/insert.php?name=%@",name];
  // to execute php code
  NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
  
  // to receive the returend value
  NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
  
  NSLog(@"%@", strResult);
  
  }
  </code></pre>
  
  <p>I've seen some people doing it with NSURLConnection method, and get response codes from the request they make, but I'm not doing it (my php file takes care of the POSTS) this way so i am wondering if I am doing it the right way. </p>
  
  <p>Again my question is how can I let the user know they have successfully inserted into the database? (I am hoping with a popup saying insert has been completed, after button has been pressed, but I need a way to get the return value of the page request.)</p>