How to post data from iOS app to MySQL database?

前端 未结 3 426
独厮守ぢ
独厮守ぢ 2021-01-24 23:11

I saw a similar post to my question but his solution did not work for me for some odd reason and it is making me age faster than Obama.

Basically I want to post data fro

3条回答
  •  隐瞒了意图╮
    2021-01-24 23:40

    I figured it out and here is the code below.

    PHP

    
    

    iOS

      NSString *strURL = [NSString stringWithFormat:@"http://www.example.com/register.php?firstname=%@&lastname=%@&password=%@&email=%@&",firstName.text, lastName.text, password.text, email.text];
        NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
        NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
        NSLog(@"%@", strResult);
    

提交回复
热议问题