-1
I have 5 tables in my system:
pacientes - Primary key idPacientes
anamnese - foreggin key idPacientes
avaliacoes - foreggin key idPacientes
intervencao - foreggin key idPacientes
contrato - foreggin key idPacientes
The table pacientes
has the primary key called idPacientes
, the others have foreign keys connected to the patient.
I am making a report for when I finish registering, make anamnesis, evaluate, intervene with the patient and give your contract, I pull all the information that are on anamnese
, avaliacoes
, intervencao
and contrato
of the patient.
But I don’t know how to make one select
of this. My teacher helped me by giving an example, but that only takes information from patients and anamnesis:
SELECT PAC., FIC.
FROM PACIENTES AS PAC INNER JOIN anamnese AS FIC ON PAC.idPacientes=FIC.idPacientes
where pac.idPacientes = '$id'
Where it is written PAC
and FIC
are the nicknames of the tables pacientes
and anamnese
. I want to have the same thing SELECT
, but including the rest of the tables.
You want to create a query that returns data from the 5 tables at the same time, is that it? I didn’t understand the final paragraph, can you rephrase, please, to make it clearer? Also inform the database you are using, the question and tags.
– Pedro Gaspar
Peter, take the test using my answer and tell me if that’s what you wanted ok?
– RXSD
That’s really it André, but I tested it here and it was not given this error mysqli_fetch_assoc() expects Parameter 1 to be mysqli_result, Boolean Given in
– Pedro Lukas