right I am planning to make an application that connects to an online database to a certain website i have developed using php. the site uses MYSQL. anyways how would i allow the application on my iphone update and receive records from one of the tables with the ability to delete records aswell.
I am fairly new to programming on my iphone thanks.
You should write a webService which will connect to the database, and your iPhone app should be making calls to the webService ideally.
Duplicate of this question -
How would you connect to a Microsoft Access database sitting on a remote server through Objective-C?
There are a couple of options you can go with.
First, you can build a REST API around your database that your application can call using the built in NSConnection or ASIHTTPRequest classes. Check out this SO post: How to write a REST API?
Second, you can build a web service in front of your database that your iPhone application can connect to.
Related
So I currently have a website built with PHP and MySQL that is hosted by a provider similar to GoDaddy (called "XSERVER" or "エックスサーバー").
I've been trying to connect the MySQL server to a react-native project so that I could GET and POST information from my app, but I haven't had any luck.
The hosting company does not allow node.js to be run on their servers, so the option of express.js was eliminated.
what other option could I take to connect a PHP and MySQL server to a react-native app?
Sorry for the general and ambiguous question, I genuinely don't know who to ask or if I should give up.
The website: https://kasumushi.com/
You have many options to create an API with MySQL and PHP. This API can then be used in your React native application. You should incorporate some sort of auth mechanism to be sure that only your react app can interact with the API.
Either create one from scratch, or use a REST API framework
I'm building a PHP application that uses a MySQL database. However, this database is shared between many devices like iPhones using an app built with swift that also connects to the same database and the same principle applies to android apps. So I would like to know how to alert all devices connected to the database that a new entry was made so they can all update their tables, this entry can be done by any of the connected devices. Basically the same thing the Firebase does with the on_child_added. I used to use Firebase and it worked fine, but the web application was made using Java Script and now I need to use PHP, as it turns out using Firebase and PHP is a pain even with Firebase admin SDK for PHP, so I need to make this change. Any resources are appreciated, thank you.
I'm involved into an app that have to retrieve queries from an existing database. This db have to be implemented in php in a remote server, and will be the place where the admin will have to insert content into the shared db, but I don't know how to implement that correctly or what is the best solution.
I'm thinking about make a sqlite database with php and connect directly the app to the db, but I haven't found yet the best way to do that.
What do you think? Thank guys.
FYI, without any server communication (Web services) you can't use the website database in android application.
If you want to manage the communication between the website and the android app means you need a centralized server (probably my sql dab) which having the data of your web/mobile applications. So, after that by using the web service methods (REST/SOAP) you can achieve the communication between them
I'm thinking about make a sqlite database with php and connect
directly the app to the db, but I haven't found yet the best way to do
that.
This is not the right approach to connect mobile applications with the database. Instead you should create a middleware(REST/SOAP webservice) which runs on server. This middleware will in turn connect with the database and your mobile app whether it is android, iOS or windows app can communicate with this middleware.
So I've built a web app in PHP that relies heavily on a MySQL database. Now (for user convenience purposes) I'm trying to create the exact same app, just as an iPhone app. Granted, I have no knowledge of Objective-C (just starting to learn it), I wanted to know how to go about this. I know that I'll have to use some kind of intermediary to get Objective-C to connect to the SQL database.
So essentially my questions are: If I've already created the web app as aforementioned, could I use the same DB and tables for the iOS app version as I did for the PHP web version? Also, is there anyway to migrate any code I've created in PHP to iOS (I realize that they are two completely different languages), but I'm just curious as to whether or not I'll have to build the iOS app from 'complete' scratch.
Your best bet is to write an PHP service to talk to your database.
This way you can share this API between your app or iOS app or any other type of client app.
The service will be responsible to receive request query the database and send responses in JSON format for example.
So to make things easier, you should not query the database directly from your apps, use a common web service.
You can use your MySQL database for any purpose because it is just data. The code that will show them will be different though. If you have no knowledge about Objective-C you should consider the web-app approach.
Here are a few helper links.
https://developer.apple.com/library/safari/referencelibrary/gettingstarted/gs_iphonewebapp/_index.html
http://gigaom.com/2010/02/12/how-to-create-an-iphone-web-app/
I have an existing web app that I have written in CodeIgniter using a MySQL database.
I now want to learn how to develop an iPhone app for the web app.
I have had a look at a lot of tutorials about xcode and iphone development but I have yet to see one about connecting and displaying data from my database.
I have seen the topic of RESTful come up a few times but am unsure if this is the direction I need to go?
If anyone has had success in building an iphone app that connects to a MySQL DB, would they be kind enough to share some tips or tuts on getting started.
I was working in a similar project: http://www.savemeeting.com It consists in an app (iOS, Android and Blackberry) and a Web showing the same information. Basically you need a Web Service (RESTful, XML-RPC, SOAP...) server and a Web Service client in your app.
I recomend you to write a RESTful server, if you use Code Igniter, you can use this library: https://github.com/philsturgeon/codeigniter-restserver and then write the client in your iOS app (sorry, I have no knowledge to guide you in this part).