1.- MySQLi related tables. Many to many.
p55H_MySQL_Farmacia_v2.aia (10.2 KB)
In this topic we saw an example of "many-to-many" related tables using Sqlite:
https://community.appinventor.mit.edu/t/related-tables-simplesqlite-extension-pharmacy-example/88326
Now let's see that same example with MySQLi.
- We have a database with three tables:
- In the tables pacientes and vademecun we have registered patients and medicines.
- A patient can have several medicines:.
- One type of medicine can be assigned to several patients:
- We have another table called pacientes_vademecum that will relate patients with medicines.
paciente_id: 4 (Pedro) vademecum_id (4 , 5, 3, 2) (Dolorin, Estomac, Ansiolitic, Sleepic) quantity (1, 12, 12, 9)