当用户关闭浏览器时,从mysql表中删除信息 [英] remove information from mysql table when user close his Browser

查看:70
本文介绍了当用户关闭浏览器时,从mysql表中删除信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在mysql中创建了两个名为

i m creating two table(in mysql) named

  1. table_temp_guest
  2. table_temp_order

现在,如果有客人进入,我们会将其个人信息保存在第一个表中,如果他从任何摊位购买了东西,则将其保存为table_temp_order中的临时订单.

now if a guest enters then we save his personal information in this first table and if he purchase something from any stall ,it saved as a temporary order in table_temp_order.

现在我的问题是:

我使用会话ID,因此,当用户转到注销(不检出)时, 我使用会话ID从两个表中删除了他的信息(个人和订单), 但是,如果他关闭浏览器,或者不去结帐(有任何共鸣),那么如何 从两个表中删除他的信息 请建议我该怎么做?

i m using session id, so when user goes to logout( without checkout) then i delete his information(personal and order) from both table )using session id, BUT if he close the browser, or does not go to checkout(any reson) then how to delete his information from both tables please suggest me how to do this?

其他问题: 还有其他方法可以通过其他方式完成整个过程.

additional question: is there any other way to do this whole process by some other manner.

推荐答案

您无法检测到用户何时关闭浏览器或键入新地址.基本上,您需要像其他网站一样具有超时"功能.

You can't detect when a user closes the browser or types in a new address. You basically need to have a "timeout" facility like the rest of the websites have.

这篇关于当用户关闭浏览器时,从mysql表中删除信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆