php - Use MySQL Trigger to Limit Inserts? -


we have internal php web app that's used scheduling. have multiple users trying schedule appointments same time slot, have hard limit on how many appointments can have per available time.

we've used php verify there available slots before booking, there's still enough time between php checking table , insert overbooking can still happen.

i believe solution mysql trigger checks table before insert. problem need mysql able count number of records have same "schedule_id" , "schedule_user_date" record inserted (this how many appointments exist time slot).

i have somehow let trigger know maximum time slot is, i'm stuck, since can change client client.

if have other suggestions other mysql trigger, i'd hear well.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -