如何从数据库中读取值? [英] how to read values from database?

查看:78
本文介绍了如何从数据库中读取值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我也创建了登录页面和注册页面.现在我想从注册页面获取登录页面的用户名和密码.
如何检查数据库中的值?
任何机构都可以答复我.

Hi,
I created login page and registration page also.Now i want to take username and password for login page from registration page.
How to check that values from database?
any body reply me.

推荐答案

如果要将值从注册页面插入数据库.
然后在登录时验证这些值(如果找到)然后登录.
怎么做见

简单登录页面

If you are inserting values from registration page to database.
then at the time of login verify these values if found then login.
How it can be done see

Simple login page

SELECT * FROM registrationtab WHERE username=@username AND password=@password


使用存储过程查询.您只需在代码中使用此查询即可,而无需存储过程.


this query using stored procedure.You can simply use this in your code without stored proc.


编写查询以从表名中选择用户名和密码.如果用户名和密码匹配并返回行集,则该用户为有效用户,否则为无效用户.
write a query to select username and password from your tablename. If the username and password matches and returns a rowset then the user is valid otherwise invalid user.


这篇关于如何从数据库中读取值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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