-
Notifications
You must be signed in to change notification settings - Fork 1
phpMySQL
Tim Erickson edited this page Sep 22, 2018
·
14 revisions
In early versions of these plugins, if there are data that need to be stored outside of the javascript code, we use an external database in mySQL. That requires an intermediary server-side language; we use php. In the future, these might be migrated to Firebase, but that was too hard for Tim.
The basic pattern for implementation is this:
-
foo.phpConnect.jscontains js routines that you call in order to send or receive data from the database. This file prepares requests and sends them using asendRequest()method, which usesfetch()to connect to php. -
foo.phpis run by thatfetch(); it contains code that assembles queries and runs them, and returns the results of the queries (if any) to the javascript caller (foo.phpConnect.sendRequest()).