Duplicate Field

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
nserpiot
User
Posts: 49

Duplicate Field

Post by nserpiot »

Hi,
I have a problem discovering Duplicate rows in a table, that is not more general.
My site is being used in order to denote Shifts for Pharmacies and I do not want to insert the Same Shift for the Same Pharmacy (or at least to Overwrite previous entry).
I know that "check duplicate" option exists, but I can't figure out how to use it in my example. Since, I can have many entries for the same Pharmacy, but for different days and I can have many entries for the same Day , but for different Pharmacies.
Any ideas are welcome.

BR,
Nick


scs
User
Posts: 694

Post by scs »

Make Pharmacy_field, day_field, shift_field, shift_time_field as you PRIMARY KEY


nserpiot
User
Posts: 49

Post by nserpiot »

If you mean to make all these fields Primary Keys in the PHPMAKER, I did it but did not prevent me from inserting entries for the same Pharmacy, same Time, same Shift ...


scs
User
Posts: 694

Post by scs »

Maybe you need to control all those key field is a standard format.

eg all fields are in lowercase or uppercase only.


nserpiot
User
Posts: 49

Post by nserpiot »

Thank you scs. I had left another field in the Primary and that's why it was not working. Now, it's ok. But do you think it is better to have these keys configured as Primary in MYSQL level also ?


scs
User
Posts: 694

Post by scs »

Yes. Because you need UNIQUE time table for each pharmacy on each day by each shift (and so on) in your table.


Post Reply