mardi 22 mai 2018

PHP | Mysql how to stop from inserting if any record with same id overdate exist

I am Sam and i am looking for a solution . i will try to explain the scenario . Well i have this attendance system who put a attendance every day well what i am looking is for a restriction other then php code like a restriction that can restrict users to enter duplicate record over time . For e.g I have already marked my attendance .mysql

DATE 22-05-2018 and trackingid = 1

if i try to insert mark attendance one more time it should not insert the statement .

It can be done via php and its a long code and i mean like it is possible but is there any way around with MySQL , through which we can make 2 columns unique if they both already exist just dont let user insert .




Aucun commentaire:

Enregistrer un commentaire