I have one task. I have to insert couple of columns to a mysql table.
insert into `alreadysent` VALUES (NULL,'".$mobile_number."','".$user."','".$sender."','".date('Y-m-d H:i:s')."');
if same mobile_number is inserted for 10 times, it should accept. But it should not accept after 10th insertion for that mobile_number.
I would have done it easily using select statement and insert if count less than 10. But i cannot do in this senario. SO checking for some other optimal option. We can stop insertion on duplicate entry if we declare column as unique, similarly is there anything which can give exception after n number of inserts? Thank You!