Home > Backend Development > PHP Tutorial > 请教这段语句有什么东东

请教这段语句有什么东东

WBOY
Release: 2016-06-13 13:17:29
Original
884 people have browsed it

请问这段语句有什么错误
SESSION已经START了

$username=$_SESSION['username'];
mysql_query("update userman.users set meinv=(select xueyuan from test.meinv where id=$id) where username=$username;");

没有报错,但是数据库里没有更新

------解决方案--------------------
mysql_query("update userman.users set meinv=(select xueyuan from test.meinv where id=$id) where username='$username'") or die(mysql_error());

这样看看
------解决方案--------------------
那你的 session有不有值?

echo $username; //输出看看

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