1
so I’m not getting it right about an exclusion code where it contains a condition, being that if a registered course is a foreign key in the user table the same cannot be excluded from the course table.
I will leave the print of the tables below and the exclusion code that is not getting the value, in case someone can help I will be grateful.
Here is the exclusion code:
<?php
include "../includes/conexao.php";
$idcurso = $_GET['idcurso'];
$curso = $_GET['curso'];
$usuario = $_GET['usuario'];
$consulta = mysqli_query("SELECT * FROM usuario WHERE curso = $curso");
$numregistros = mysqli_num_rows($consulta);
if($numregistros == "0") {
$sql ="DELETE FROM curso where idcurso = $idcurso";
} else {
echo "<script> alert ('Não foi possível deletar pois se encontra cadastrado um nome ao curso desejado a exclusão:'); location.href='curso.php';</script>";
}
what the problem, what error appears?
– Costamilam
Just , goes for ELSE, does not find the if, hard that do not know pq!"
– Manchado Manoel