Home  >  Article  >  Backend Development  >  求解:数据插入不到数据库中。解决方案

求解:数据插入不到数据库中。解决方案

WBOY
WBOYOriginal
2016-06-13 10:16:29842browse

求解:数据插入不到数据库中。
数据库确定已经连接成功了。表名keai_user 字段f_logintimes(登录次数) f_lasttime(最近登录时间) f_loginip(登录IP地址)
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "UPDATE keai_user SET f_logintimes = f_logintimes + 1,";
$sql .= "f_lasttime = now(),f_loginip = '$ip'";
$sql = "WHERE f_username = '$username'";
$db->query($sql);执行后表keai_user 内容没有任何变化,不知道为什么?

------解决方案--------------------

引用$db->query($sql);执行后表keai_user 内容没有任何变化,不知道为什么?

------解决方案--------------------
$sql = "WHERE f_username = '$username'"; 
 
写错了吧!
$sql .= "WHERE f_username = '$username'";
Statement:
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