I have a .php file that queries a MySQL database and gets the value of a row. (a set of names) I want a tableview to be populated with these values in Xcode. (This is for iOS) How do i access the .php file from within my app? Any help is appreciated!
Share
Assuming you know anything about obj-c – you could create a url handler to communicate with your server. Then, after making the proper .h file you would call a function like this, which returns an NSArray from the json results from your php script:
Where you pass the url you want to call as well as the expected json key from that result. You don’t need the json key per say, but I use this to abstract the request for one reason or another. This is pretty much just an example so don’t drop it in and expect it to work perfectly unless you can glance at the code and understand what each portion does.
Not a very good example, but the important part is this:
If you google search that with whatever version of ios you’re targeting you should find at least half a dozen fully working examples.
I’m going to stop there before going through a massive tutorial since there are many upon many out there. If you have something more specific to ask just post a comment and I may update my answer.