title: xcode updating mysql remote database using PhP
body: <p>I have been following this <a href="http://www.youtube.com/watch?v=LwCyaGoRNWM" rel="nofollow">great tutorial</a>  and got my codes to working with most of the database transfers. Now I'd like to use the same method to update long text messages and images onto my server MySQL database, but it doesn't seem to work.</p>
  
  <pre><code>NSString *strURL = [NSString stringWithFormat:@"http://mydomain.com/sync.php?name=%@&amp;message=%@&amp;image=%@",nameField.text, messageField.text, image];
  </code></pre>
  
  <p>and then </p>
  
  <pre><code>NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
  
  NSString *strResult = [[[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding] autorelease];
  NSLog(@"StrResult is... %@", strResult);
  </code></pre>
  
  <p>Problem 1:  When the <strong>messageField.text</strong> is a long text with blank spacing in between such as <em>"This is a free text format with up to 1000 characters..."</em> , it will cause strURL to have blank spaces as well, and thus strResult will become null.</p>
  
  <p>Problem 2:  <strong>image</strong> is of blob format which I already saved in the local sqlite. I'm not even sure if transferring this way is a good idea. But basically I want to upload the image from iPhone/iPad straight onto a server MySQL database.</p>
  
  <p>Hope someone could help me with either one of these 2 problems. Or are there any better and easier alternatives to update MySQL on my server? Thank you!</p>