Home > Backend Development > PHP Tutorial > tkinkphp查询总是出现怪问题

tkinkphp查询总是出现怪问题

WBOY
Release: 2016-06-23 13:49:36
Original
1050 people have browsed it

$data['username']=$_POST['username'];
 $data['password']=$_POST['password'];
 $m=M('User');
 $login=$m->where($data)->select();
组成的SQL语句是这样的SELECT * FROM `tp_user` WHERE ( `password` = '11' ) [ RunTime:0.000874怎么没有username呢?


回复讨论(解决方案)

没你这样用的,$data是个数组,你放where里当查询条件算怎么回事!是不是理解混了? $data可以在数据添加和更新的时候来用

Related labels:
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