Hello everyone I am trying to insert my user data in myaql database using JSON. But i am unable to do so, data is not inserting and getting no error. following is my code.
Objective C Code
{
NSString *post =[NSString stringWithFormat:@"name=%@&email=%@&password= %@&phone=%@",self.name.text, self.Pass.text,self.phone.text,self.email.text];
NSData *data = [post dataUsingEncoding:NSUTF8StringEncoding];
NSURL *url = [NSURL URLWithString:@"http://my url"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:data];
NSURLResponse *response;
NSError *err;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
NSLog(@"responseData: %@", responseData);
}
I am using this code to insert textfields data into my mysql database.It seems no error but data is not inserting in my database. Thanks in Advance.