使用mysql&检查密码密码() [英] Checking password with mysql & PASSWORD()

查看:137
本文介绍了使用mysql&检查密码密码()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的mysql数据库中,我已经使用PASSWORD()

函数存储了所有密码。现在我正在运行测试,需要将我的php

文档中的密码与保存在数据库中的密码进行比较。我使用了字符串


"从用户中选择名称密码= PASSWORD(''$ testPass'')"


并运行mysql_query()使用字符串。但没有任何回报。所以我

决定运行测试并尝试使用

字符串来改变我的php页面的密码


更新用户设置密码= PASSWORD(''$ newPass'')其中name =''userName1''"


,它工作正常。我的数据库已正确更新。所以我的问题是,为什么

我不能使用PASSWORD函数找到匹配,但仍然可以更新我的

表?

In my mysql database, I''ve stored all the passwords using the PASSWORD()
function. Now I''m running a test and need to compare the password in my php
document to that saved in the database. I used the string

"Select name From users Where password = PASSWORD(''$testPass'')"

and ran mysql_query() using the string. But nothing was returned. So I
decided to run a test and try to change a password from my php page using
the string

Update users Set password = PASSWORD(''$newPass'') Where name = ''userName1''"

and it works fine. My database is updated properly. So my question is, why
can''t I find a match using the PASSWORD function, but can still update my
table?

推荐答案

testPass'')"


并使用字符串运行mysql_query()。但没有任何回报。所以我

决定运行测试并尝试使用

字符串来改变我的php页面的密码


更新用户设置密码=密码(''
testPass'')"

and ran mysql_query() using the string. But nothing was returned. So I
decided to run a test and try to change a password from my php page using
the string

Update users Set password = PASSWORD(''


newPass'')其中name =''userName1''"


,它工作正常。我的数据库已正确更新。所以我的问题是,为什么

我不能使用PASSWORD函数找到匹配,但仍然可以更新我的

表?

newPass'') Where name = ''userName1''"

and it works fine. My database is updated properly. So my question is, why
can''t I find a match using the PASSWORD function, but can still update my
table?


2004年8月14日星期六22:12:24 GMT,John Victor <无线****** @ pacbell.net>写道:
On Sat, 14 Aug 2004 22:12:24 GMT, "John Victor" <wi******@pacbell.net> wrote:
在我的mysql数据库中,我已经使用PASSWORD()
函数存储了所有密码。现在我正在进行测试,需要将我的php
文档中的密码与保存在数据库中的密码进行比较。我用了字符串

"从用户中选择名称密码=密码(''
In my mysql database, I''ve stored all the passwords using the PASSWORD()
function. Now I''m running a test and need to compare the password in my php
document to that saved in the database. I used the string

"Select name From users Where password = PASSWORD(''


这篇关于使用mysql&amp;检查密码密码()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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