Home > Backend Development > PHP Tutorial > ThinkPHP 框架 关于数据库是否存在某值的问题

ThinkPHP 框架 关于数据库是否存在某值的问题

WBOY
Release: 2016-06-23 14:23:18
Original
1789 people have browsed it




就是想做一个登录系统,但是提交先前注册好的总是输出





是不是where()哪里出问题了,该怎么改啊?

我的数据库中账号为  account_number


回复讨论(解决方案)

看看日志,或者试一试

$condition['usename'] = '江南可采莲';$User->where($condition)->select(); 
Copy after login

额,账号值不是固定的啊,

where('account_number=$username')
至少应写作
where("account_number=$username")
考虑到 $username 可能不是纯数字
所以应写作
where("account_number='$username'")

where(array('account_number' => $username))

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template