Good afternoon everyone
I have a problem of duplicity in my table when the patient schedules the same date and time the same day, I tried this code but without results, someone has how it gives me a light.
thank you
global $conn;
if ($values["id_cpf"]!=$oldvalues["id_cpf"])
if ($values["dt_atendimento"]!=$oldvalues["dt_atendimento"])
if ($values["turno"]!=$oldvalues["turno"])
{
$strSQLExists = "select from agm_agendamento where id_cpf='".$values["id_cpf"]."'";
$strSQLExists = "select from agm_agendamento where dt_atendimento='".$values["dt_atendimento"]."'";
$strSQLExists = "select * from agm_agendamento where turno='".$values["turno"]."'";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
if($data)
{
echo "<center><b><font color=red>Already scheduled date and shift!</font></b></center>";
return false;
}
}