关于账户激活的奇葩问题,
请教大神我这段代码有什么问题,以前好好的 ,现在却出现莫名问题,编辑器是netbeans,也重新安装过.
现在运行时能执行到第二个_query函数,也就是对数据库的操作成功了,之后就跳过mysql_affected_rows()那段直接执行下面的 else {
_alert_back('非法操作');
}
<br />if (isset($_GET['active']) && $_GET['action'] === 'ok') {<br /><br /> $_active = _mysql_string($_GET['active']);<br /><br /> if (mysql_fetch_array(_query("SELECT tg_active FROM tg_user WHERE tg_active='$_active' LIMIT 1"),MYSQL_ASSOC)) {<br /><br /> //将tg_active设置为actived<br /> _query("UPDATE tg_user SET tg_active='actived' WHERE tg_active='$_active' LIMIT 1");<br /><br /> if (mysql_affected_rows() == 1) {<br /><br /> mysql_close();<br /><br /> _location('账户激活成功','login.php');<br /><br /> } else {<br /><br /> mysql_close();<br /><br /> _location('账户激活失败','register.php');<br /> }<br /> } else {<br /><br /> _alert_back('非法操作');<br /> }<br />}<br />
<br />if (mysql_fetch_array(_query("SELECT tg_active FROM tg_user WHERE tg_active='$_active' LIMIT 1"),MYSQL_ASSOC)) {<br /> <br /> //将tg_active设置为actived<br /> _query("UPDATE tg_user SET tg_active='actived' WHERE tg_active='$_active' LIMIT 1");<br /> <br /> if (mysql_affected_rows() == 1) {<br /> <br /> mysql_close();<br /> <br /> _location('账户激活成功','login.php');<br /> <br /> } else {<br /> <br /> mysql_close();<br /> <br /> _location('账户激活失败','register.php');<br /> }<br /> } else {<br /> <br /> _alert_back('非法操作');<br /> }<br />