0
I’m having trouble creating the select
to later use in a table.
The mandatory SQL tables are the following:
“Aluno” (**PK:** id, numero, nome),
“Area” (**PK:** id, nome),
“UC” (**PK:** id, nome, **FK:** id_area)
“Classificacao”
(
**PK:** id,
**FK:** id_uc,
**FK:** id_aluno,
nota
)
Goal is to create a table in php (mvc) as follows:
- Column - Student No
- Column - Student name
- Column - Nº disciplines of the student in the area 1
- Column - Nº disciplines of the student in the area 2
- Column - If the sum of disciplines is greater than or equal to 6 "Yes" (Admitted)
With the entities and relationships that exist between the tables, which select
I have to do the SQL to fill the table?
I actually have the skeleton MVC and select
of the leaderboard
function getClassificacao()
{
$classificacao = array();
$db=new db();
$con=$db->connect();
$sql_query = "SELECT * FROM classificacao";
$result = $con->query($sql_query);
$i = 0;
while($row = mysqli_fetch_array($result))
{
$classificacao[$i]["id"] = $row["id"];
$classificacao[$i]["id_uc"] = $row["id_uc"];
$classificacao[$i]["id_aluno"] = $row["id_aluno"];
$classificacao[$i]["nota"] = $row["nota"];
$i++;
}
return $classificacao;
}
I’m grateful, someone can separate by several selects?
– get a life
Pq varios selects? You understand at least logic?
– tkmtts
The problem is that, I did not understand the logic, I intend to divide by sub selects in order to understand and use later.
– get a life