I'm having trouble creating select
for later use in a table.
The required SQL tables are as follows:
“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
)
Objective is to create a table in php (mvc) as follows:
With the entities and relationships that exist between the tables, what do I have to do to SQL to populate the table?
Currently I have the MVC skeleton and select
of the rating table
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;
}