This topic is locked

duplicate value row

9/28/2019 1:54:14 PM
PHPRunner General questions
brito author

Good afternoon, I have this problem and can not solve, can someone help me ...
I need the system to check the entire row duplicity.
Thanks

//......

global $conn;

$strSQLExists = "select * from agm_agendamento where pac_cpf='".$values["pac_cpf"].$values["d_data"].$values["d_turno"]."'";

$rsExists = db_query($strSQLExists,$conn);

$data=db_fetch_array($rsExists);

if($data)

{

echo "<center><b><font color=red>Existe outra consulta no mesmo horário!</font></b></center>";

return false;

}
Sergey Kornilov admin 10/1/2019

You need to explain what "check the entire row duplicity" means.

brito author 10/2/2019



You need to explain what "check the entire row duplicity" means.


I have a schedule of schedules that I need to check the inclusion of each appointment, the patient does not schedule for the same day and time and need to inform him that can not schedule.

Sergey Kornilov admin 10/2/2019

I guess your SQL query should be along the lines of

select * from agm_agendamento where pac_cpf='value of pac_cpf field' and d_data='value of d_data field' and d_turno='value of d_turno field'


More info:

https://www.techonthenet.com/sql/where.php