• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Execute Query before Session Ends

New Here ,
Sep 29, 2006 Sep 29, 2006

Copy link to clipboard

Copied

Hello,
I am working on an applicationt that is basically a virtual lineup to book appointments. Basically, users log in and are presented with the next available time slot from the database. They can either confirm the time or log out. When they confirm the time, the time is then marked as "taken" in the database..

"times table"
slot_id
date
time
taken (bit)
offered (bit)

I realized yesterday that if Person A logged in and was offered time_slot = 1, then if person B logged in before person A finished registering (confirm) then Person B would also be offered time_slot = 1. To overcome this, I created the "offered" field. Basically, as soon as a time is offered, the "offered" field turns from 0 to 1. So now, when Person A logs in, the time they are offered is set to "1" and when person B logs in, they are given the next available time that is not "offered" or "taken".

I hope you are following.

What I am having trouble doing now is the following...
If person A logs in, is offered a time_slot and that time_slot becomes marked "offered"...when they logout or close the window the time_slot remains marked as "offered" i.e. "offered = 1". I am trying to figure out a way to automatically change the specific time_slot's "offered" field back to 0 in the case that it is not confirmed. Does this make any sense?
Please help,
Thank you.
TOPICS
Advanced techniques

Views

181

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 29, 2006 Sep 29, 2006

Copy link to clipboard

Copied

LATEST
If you are using CF7, you can use Application.cfc and specify the necessary code in the onSessoinEnd method.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation