How to connect to a MySQL database from an iPhone?

后端 未结 2 750
我寻月下人不归
我寻月下人不归 2020-12-04 20:25

I am trying to connect to a remote mysql database from an iPhone. I have searched many web sites but I did not find any help. If anyone has worked with this please send a s

相关标签:
2条回答
  • 2020-12-04 21:07

    A quick google will show you the way...

    0 讨论(0)
  • 2020-12-04 21:09

    Assuming you have some experience with server-side programming (like PHP or Rails), you could just create an NSArray from the content of a URL where you establish a connection to the MySQL server and print the results you want in ASCII or XML format.

    NSURL *myURL = [NSURL URLWithString:@"http://www.myserver.com/results.php"];
    NSArray *sqlResults = [[NSArray alloc] initWithContentsOfURL:myURL];
    

    Also useful to help you format the results printed by the server page: http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/PropertyLists/Introduction/Introduction.html

    0 讨论(0)
提交回复
热议问题