Ultimately dumb example, which posts login information to php backend then backend sends result back as json. Login.db Login.php App.js
Here is a silly example to use Chart.JS . However, we are using advantages of PHP. I personally do not recommend to use that way in production. Maybe the second way? We have a database with 3 columns. Embedded PHP Code Second way. Smarter Maybe???
Here is a simple PHP SQLite3 User Login example. First create our database called Login.db in SQLite3. You will want to insert sample data in that database. Let’s create our HTML form. Login.php
First of all we need to create our database. I am choosing SQLite as always. We got 4 columns: id, temperature, humidity and day. chart.db Here is our PHP backend. json.php Do not forget to enable CORS with Allow-Origin: * just same as in example code. Here is our React code. App.js
Super simple example to get data from SQLite database and print as JSON array in PHP