如何从两个不同的页面保存一个表中的数据 [英] how to save data in one table from two different pages

查看:68
本文介绍了如何从两个不同的页面保存一个表中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有注册页面(姓名,用户名,密码,确认密码,电子邮件,手机),我在数据库的注册表中插入这些详细信息。在此之后,用户使用用户名和密码登录网站。登录后我再给一页,即会员资格,其中包括详细信息(性别,国籍,教育详情,地址,就业历史)。





现在我想在注册表中输入这些会员资料(相同的ID)。



会员详情应该输入登录该站点的用户,仅输入特定的登录人员详细信息。使用Sql server 2008





提前致谢

I have Registration page (Name,Username,Password,Confirm password,Email,Mobile), am inserting these details in Registration table in database. after this the user login into the site using username and password.After login am giving one more page i.e membership this includes detailed information(Gender,Nationality,Educational details,Address,Employment history).


Now i want to insert these membership details also in registration table(same id).

the membership details should enter who logged into the site,particular logged person details only entered.using Sql server 2008


Thanks in advance

推荐答案

当用户登录时,您将获取他的详细信息,如用户名密码等...获取用户I D也将其保存在 Session 中。如果您的用户名是唯一的,则无需获取 ID



然后当您更新会员资格详细信息,只需从会话获取 ID ,然后使用 ID 运行查询条件仅更新该用户的数据。
When user Logins, you are going to fetch his details like Username, Password etc... Fetch the User ID too and keep it in Session. If your Username is unique, then no need to get the ID.

Then when you update the Membership details, just get the ID from Session and run a query with the ID in condition to update the data for that user only.


这篇关于如何从两个不同的页面保存一个表中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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