Hi Everyone,
I have created a php/mysql site. When a guest comes to the site a temp table is automatically created for them in mysql, saving all their entries and data. I would like to have this temp table dropped when the guest leaves the site. Can someone please tell me how to accomplish this?
Thanks for your help guys,
Banko
How to Drop Table on Session Condition
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
the table is for a temporary quote.
Basically the person fills out a form, the data is retrieved from the form, a query is sent to the database to get the rates on the selected item. Calculations are made to the data submitted and then all is saved to the guests table so he can keep adding items. Every time he makes an addition the page displays what he has added so far and what the total is, and gives the option to add or remove data from his table.
Basically unless you know away to store and keep a running track of his entries without creating a table for him I would love to here it.
I am new to database design, and welcome any suggestions. Think of the table as a shopping cart that i want deleted at the end of his session.
Basically the person fills out a form, the data is retrieved from the form, a query is sent to the database to get the rates on the selected item. Calculations are made to the data submitted and then all is saved to the guests table so he can keep adding items. Every time he makes an addition the page displays what he has added so far and what the total is, and gives the option to add or remove data from his table.
Basically unless you know away to store and keep a running track of his entries without creating a table for him I would love to here it.
I am new to database design, and welcome any suggestions. Think of the table as a shopping cart that i want deleted at the end of his session.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
two options:
Two tables or one table
The two table approach
Store minor (more global) details about the possible order here (this is where the session data is sent, overall)
The second table holds items in their order. Each item is keyed to the Session ID or some other reference to their entry in the first table.
The one table approach
Only items are kept in this table. They reference to the user in some unique way. Some of the data stored here will likely be redundant.
Two tables or one table
The two table approach
Store minor (more global) details about the possible order here (this is where the session data is sent, overall)
The second table holds items in their order. Each item is keyed to the Session ID or some other reference to their entry in the first table.
The one table approach
Only items are kept in this table. They reference to the user in some unique way. Some of the data stored here will likely be redundant.