
Quote from luishp on March 30, 2020, 7:37 pmFor learning purposes we have been using a SQLite database in our video tutorials but, if you are an advanced user, you would probably be interested in using MySQL instead.
The process is not hard and in fact it's not necessary to do any changes to your app, just to the config.php file and some server adjustments. Let's start!https://youtu.be/MjxJPnu9Lvw
This is the key code for config.php:
//MySQL database setup $dbAlias[0]="db1"; $dbNames[0]="your_database_name"; $dbServerNames[0]="your_mysql_host"; $dbUserNames[0]="db_username"; $dbPasswords[0]="db_password";
For learning purposes we have been using a SQLite database in our video tutorials but, if you are an advanced user, you would probably be interested in using MySQL instead.
The process is not hard and in fact it's not necessary to do any changes to your app, just to the config.php file and some server adjustments. Let's start!
This is the key code for config.php:
//MySQL database setup $dbAlias[0]="db1"; $dbNames[0]="your_database_name"; $dbServerNames[0]="your_mysql_host"; $dbUserNames[0]="db_username"; $dbPasswords[0]="db_password";

Quote from rocote on March 30, 2020, 8:26 pmHola Luis, gracias de nuevo por este gran video. ¡Es genial!
¿Desea escribir la Parte 7 o la Parte 6 debajo de la descripción del video en Youtube?
Sé que la parte 6 ya existe y tú escribiste la parte 7. Así que solo quería decírtelo.
Verá, tomé una clase de español esta mañana con la Sra. Google y ahora puedo hablar con usted en su lengua materna. :)¡Gracias otra vez!
Roger :)
Hola Luis, gracias de nuevo por este gran video. ¡Es genial!
¿Desea escribir la Parte 7 o la Parte 6 debajo de la descripción del video en Youtube?
Sé que la parte 6 ya existe y tú escribiste la parte 7. Así que solo quería decírtelo.
Verá, tomé una clase de español esta mañana con la Sra. Google y ahora puedo hablar con usted en su lengua materna. :)
¡Gracias otra vez!
Roger :)

Quote from Ronnie on March 31, 2020, 10:59 amHi @luishp, your demos look good and clearer. I'm tempted to try out the remote database as a viable option to my current project.
Just some questions, using your TELEPHONE app as reference.
- There are 10 authorised users accessing the app. A master DB is used to authenticate user login/pwd access. I presume this would be the main DB used by the app.
- Each user has their own recordDB, which means if there are 10 authorised users, there'd be 10 individual DB assigned to each user. How do I create/setup that? Do I need multiple config?
- When user choose "SAVE TO HOMESCREEN", would there recordDB be accessible?
- What if they turn ON the airplane mode, would there be a temp local copy of their recordDB?
Thanks, Ronnie
Hi @luishp, your demos look good and clearer. I'm tempted to try out the remote database as a viable option to my current project.
Just some questions, using your TELEPHONE app as reference.
Thanks, Ronnie

Quote from luishp on March 31, 2020, 11:41 amHi @ronnie
There are 10 authorised users accessing the app. A master DB is used to authenticate user login/pwd access. I presume this would be the main DB used by the app.
Currently I have only explained how to create a single user access but it's possible to add multiple users with different access levels. Please take a look at the config.php template file for more info.
Each user has their own recordDB, which means if there are 10 authorised users, there'd be 10 individual DB assigned to each user. How do I create/setup that? Do I need multiple config?
No, it doesn't work that way. You should add a new field to the table with the owner userid. A single table in a single database will store all the data but you only show to each user it's own data.
When user choose "SAVE TO HOMESCREEN", would there recordDB be accessible?
The client side files are cached while the database and server side files ramins in your web server. It will be accesible whenever there is an Internet connection.
What if they turn ON the airplane mode, would there be a temp local copy of their recordDB?
You have to save a copy first (Stringified JSON data on a localStorage variable) and detect there is not connection to load data from that variable instead of the remote database.
I will be back to more advanced database tutorials in the near future. Your questions are very interesting to talk about them.
Hi @ronnie
There are 10 authorised users accessing the app. A master DB is used to authenticate user login/pwd access. I presume this would be the main DB used by the app.
Currently I have only explained how to create a single user access but it's possible to add multiple users with different access levels. Please take a look at the config.php template file for more info.
Each user has their own recordDB, which means if there are 10 authorised users, there'd be 10 individual DB assigned to each user. How do I create/setup that? Do I need multiple config?
No, it doesn't work that way. You should add a new field to the table with the owner userid. A single table in a single database will store all the data but you only show to each user it's own data.
When user choose "SAVE TO HOMESCREEN", would there recordDB be accessible?
The client side files are cached while the database and server side files ramins in your web server. It will be accesible whenever there is an Internet connection.
What if they turn ON the airplane mode, would there be a temp local copy of their recordDB?
You have to save a copy first (Stringified JSON data on a localStorage variable) and detect there is not connection to load data from that variable instead of the remote database.
I will be back to more advanced database tutorials in the near future. Your questions are very interesting to talk about them.


Quote from CDY@44 on March 31, 2020, 2:53 pmHi Luis,
Once again, thank you very much for the care you take in providing us with quality tutorials!
Best regards,
Hi Luis,
Once again, thank you very much for the care you take in providing us with quality tutorials!
Best regards,
Quote from Ronnie on March 31, 2020, 3:14 pmHi @luishp, thanks for the reply. Didn’t think of using userid as a “key field” for specific record access, which is interesting. Yes, more video demos would make it easier to absorb the ideas. I was initially hesitant for my lack of server DB portion through pho etc, although using SQLite is not an issue. Your database demos do showcase what can be done. Looking forward to more DB demo sequels..
Hi @luishp, thanks for the reply. Didn’t think of using userid as a “key field” for specific record access, which is interesting. Yes, more video demos would make it easier to absorb the ideas. I was initially hesitant for my lack of server DB portion through pho etc, although using SQLite is not an issue. Your database demos do showcase what can be done. Looking forward to more DB demo sequels..