Skip to content

phpMySQL

Tim Erickson edited this page Sep 22, 2018 · 14 revisions

PHP and mySQL

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.js contains js routines that you call in order to send or receive data from the database. This file prepares requests and sends them using a sendRequest() method, which uses fetch() to connect to php.
  • foo.php is run by that fetch(); 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()).

More details

Clone this wiki locally