I just want to ask on how to send textfield value into mysql database in xcode using obj c without any click action or with click action?
If the code below can retrieve and display JSON data from web server into xcode:
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize username,email;
- (void)viewDidLoad {
[super viewDidLoad];
NSError *error;
NSString *url_string = [NSString stringWithFormat: @"http://localhost/test.php"];
NSData *data = [NSData dataWithContentsOfURL: [NSURL URLWithString:url_string]];
NSMutableArray *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSDictionary *dict = [json firstObject];
NSString *data1 = [dict valueForKey:@"username"];
NSString *data2 = [dict valueForKey:@"email"];
email.text = data1;
pw.text = data2;
}
@end
How to post username, email value into mysql database? Is it the same technique applied on post method? Because I do not want to use SBJson classes (if possible).