Hello Donald,
Well now we have a can of worms.
I will email you later my script with some notes about it.
In your sample database, I see you have alot of scripts located locally. Where does this database exist? Is it created on my pc when run?
The PHP script must be placed along with our application if we deploy in order to run in mobile or desktop browsers. If our target is also the Android platform, for example, then the PHP scripts must be located in our app's server.
If we take a look at the Database sample PHP scripts there is exactly what we need:
Database.php
It's the PHP Database useful because we share it between the other scripts and provide us the hability to connect to databases (not only MySQL, but all supported by PHP PDO), retrieve data, insert data, etc. In an easy way. This PHP Database class is picked from my Humm PHP project.
PDOExtended.php
Not too much to say except this is our PHP PDO extended class used internally by the above Database class.
Initialize.php
This is just a "template" script, which is included by others in order to reuse their code. Basically we provide the appropiate responses for CORS requests (from our application) and connect to the database, leave it ready to be used.
The above PHP scripts are the stuff we use to interact with the Database. The below scripts are "entry points" for our application's HTTP calls:
DeleteNotes.php
Used to delete notes from the database from our application.
NewNotes.php
Used to add notes to the database from our application.
ShowNotes.php
Used to request notes from the database to be shown in our application.
UpdateNotes.php
Used to update notes in the database from our application.
Is it possible at some time to see a sample database that will connect to a remote server, login and access an existing database?
Then via the script on the server, make changes to the database, If that is what the current sample is doing I cannot follow it.
That is what the Database sample does. In fact the application connect to the server PHP scripts, who are responsible to connect and perform operation over the database. The Database sample performs HTTP calls using the HTTP Client control in order to connect to the server. When we want to insert a new note, the application calls to the "NewNotes.php" providing the new note data, and wait for the server response (an error occur? is the note inserted?). If we want to update a note the Database sample calls to the "UpdateNotes.php" with the appropiate note data, and so on.
I would envision an app that selected the database name, table and field and then allowed a input to provide new data for the field selected.
If it can all be done without a script then great if not then a script would be needed. (I am not asking you to do that).
Thanks
Currently we need to deal with scripts "manually". Maybe in the future I can prepare something "visual", Donald, but, honestly, I can't promise nothing at this time. However, in fact the required server side script can be not too difficult to create or adapt, for example, take a look at the "InsertNote.php" used by the Database sample:
Of course we need to know something about PHP (or the language we want to use in the app's server), but, maybe look into the above code (which is reponsible to delete notes from the database) appear more or less easy than if we look into the entire PHP scripts in a whole.
On the other hand, taking a little look at your PHP script, apparently they expects two input arguments: "TYPE" and "MESSAGE", so, probably we can use such script as is, without touch, just by perform the appropiate HTTP call from our application, providing such arguments.