Problem:
I have Admin web portal which builds on PHP (CodeIgniter). which I want to make Sync Immediately while there is some change in Database.
Confusion :
As far as I tried to check from Google to solve the problem, there are two way I found
Push notification for notifying to web portal on change of database
Long Pooling which continuously listen to change and sends to the web portal.
Backend Database: MySql
Kindly please help me to get Best Practice for it. and also suggest more option if available.
Related
Im currently developing a system using PHP and MySQL, what is required of the system is that it should allow the user be able to access the database on a standard GUI online (web browser) and should also be able to access the database offline, now can anyone help me with a method of how to make this possible.
The idea i have right now (me thinking out of the box) is using local host database manager like xampp which will be offline and an online database manager were the system will be hosted but cant figure out how will both databases be synchronized so that they stay the same.
If you want to have two databases maybe you will have to use a mirroring system. This one, wil help you to mantain the database syncronized with the database of the server with the local or not accessible database. You also can have a look at this link for more information Right way to mirror a PHP/MySQL setup
I am sorry if this is the wrong stack exchange, if so please redirect me.
I am very much in doubt about how I go about the following, and I can't really seem to google my way to a solution, so here goes:
Let's say I have a website which basically only consists of a search bar, which I want to link up to a database which every user can search in. In addition to this I want to be the only one who can actually add new data to this database.
To do this, would I basically "just" buy a website domain, make some SQL query hookup to a database that I rent from fx Microsoft Azure? Then whenever people would search for a string the website would query the database and return any relevant information.
Is this the correct way to go about this issue?
For your scenario, I would suggest you use Azure App Service MySQL in-app, which has a cool feature for Web developers to create Web applications that use MySQL. You don’t need to provision a database explicitly as during the creation of the web app when using this feature.
For more details, please refer to Announcing MySQL in-app for Web Apps and Create a PHP web app in Azure.
Hi all,
i want create mobile app (i use phonegap) that retrieve and insert data in MySQL Database on web server also i will create website that connected to the same Database using (PHP).
I need guidance:
What topics should i know/use ?
What things should be implemented in Web development process ?
Can i use shared host or i will have to rent dedicated server ?
Is phonegap the right choice to accomplish the project ?
.........
Any guidance will be great.
Thank you All.
Your lack of familiarity with the technologies involved leads me to believe you are making a mole hill out of a mountain. All the skills involved need time/effort and no one answer here will cover your question.
There are various methods to achieve what you ask... I suggest starting with learning how to write some HTML5, then move on to doing a bit of Javascript and then follow it with a bit on jQuery. These skills are what you will use to place text on your web page or app.
After that, learn how to install MySQL, Apache, MySQL and PHP on your laptop. These skills will help you save data on to a server.
Then you need to learn how to combine them so that the data sent from your web app gets checked prior to saving on the server.
Then follow with how to read the data from the server and prepare it for re-display back on your web page or web app.
Once that is done - learn how to use the PhoneGap build service so you can package your app and try it on your device.
I suspect if you start now, and do 10-20 hours a week, you might get something buggy working by Christmas.
Best of luck!
This topic has been raised a few times but even after searching and going through suggestions I haven't found a solution.
I have a PHP based website and an Android app that has to use the same database. The database is for an objective type test. The questions are created on the web using an admin panel.
The Android app needs to work offline so there is a need for one time sync when internet is available.
I have created a table in PHPMyAdmin called "database version". The Android app checks the database version using a web service. If the the version number is different it should be able to download the latest version of the database of the website and store it locally for offline access.
One of the suggestions I've come across is to convert the .sql database into .sqlite and give the download link of .sqlite to the Android app. However, converting .sql database to .sqlite using PHP doesn't seem to be easy. I've come across some shell script method but with no knowledge about that it probably doesn't work for me.
So, I'm looking for way to make sure the Android app can use the same database of the website but only require internet connection for syncing otherwise the app will work offline.
Would appreciate if I could get some directions and advise as to how to accomplish this.
Thanks!
Actually, I'm not sure If I would choose a solution that "replaces" the database when your app gets back online. I think I would build a database on the Android (SQLite), and synced with the Webdatabase (MySQL) row by row, by comparing datastamps.
I am new in mobile development and I have a project to do and I spent the whole past days searching for solution to a problem until I got lost so I hope I can find the final answer here.
I have a server (php & MySQL DB) and developing a mobile app in iOS + Android that retrieve data from the server. The mobile app should take the data from the server in the first run and save it in the phone so whenever it run again it take the stored data.
The server should notify the app "without the user being aware" whenever a change made so that the app can go and update the data immediately.
I thought about using webservice (probably REST with RestKit) or applying sort of timestamps on the server records, which are all not the problem.
My problem is that I can't find a way to let the server itself notify the app about the changes whenever a change happen and allowing the app then to update the new data. I thought about using push notifications but - specially in iOS - it can't be hidden from the users.
So is there a possible way to do it? is it complex? does it worth? other suggestions?
As I said I am new so maybe my thinking wrong so sorry in that case, and I searched through the questions and couldn't figure out an answer for my question.
Can you explain what you are trying to do?
The classic idiom here would be to update the data when the application is started (you can use the cached version is it's still up-to-date and if the user has no connection)
Why update the data if the user is not aware of it?
At least in iOS, a solution would be to use Apple Push Notifications. If you don't want to be intrusive and want it to be as transparent as possible, you can define what kind of "notifications" signals you want, like this:
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
As for the background process, I don't think you would be able to do that. Apple is very strict in what you can do in background (not background thread, but background as a working process while you are not in the application). What I would advise, would be using a notification badge, so the user would know that there is something new, and when he entered the application you could start your update.
I have to agree with Yase:
Why update the data if the user is not aware of it?.
You should always make it as user friendly as possible. Not letting your user know that the application might consume resources is bad, in my opinion. Imagine that you are updating 2mb of information and the user is on 3G...
I'm not sure if I am following your question right but it sounds like you want the server to be aware that changes have been made and then notify the user of those changes.
Why not run a cron job to check the server on whatever timed cycle you want and then either send a push notification to the user (on iOS)
iOS Push Notificaton Tutorial
I've little Android experience but it seems stickier to do push notifications on those devices. (I'm sure someone will correct me on that soon enough though : D )
This might help:
Android Push Notifications
It is not possible on iOS without the user being aware of the app - the only way you can update the application data from server side is if...
...the application is open and you are holding a tcp connection open
...you send a push message (so that the user opens the application)
In both cases the user is aware of that the application is running. What you can do is that you update the data in the background while the user is using the app. You can use push messages to make the user open the app. But that's it.
On Android there may be some more possibilities if you let the application run a background service, however don't forget that users will remove your app if it is draining batteries etc.
For application data update you should check the version of your data on server. The best way for this is to make your app to ask your server every time user launches the application: user launches app -> app asks server if there is new data in RESTful API style -> server response that yes/no -> if there is new data, application loads it to the device.