if(isset($_GET['action'])&&isset($_GET['active'])&&$_GET['action']=='ok'){
$_active=_mysql_string($_GET['active']);
if(_fetch_array("select tg_active from tg_user where tg_active='$_active' limit 1")){
//将tg_active设置为空
_query("update tg_user set tg_active=null where tg_active='$_active' limit 1");
if(_affected_rows()==1){
mysql_close();
_location('账号激活成功', 'login.php');
}else{
mysql_close();
_location('账号激活失败', 'register.php');
}
}else{
_location('账号激活失败', 'register.php');
}
}
参数没问题
$_active=_mysql_string($_GET['active']);
if(_fetch_array("select tg_active from tg_user where tg_active='$_active' limit 1")){
//将tg_active设置为空
_query("update tg_user set tg_active=null where tg_active='$_active' limit 1");
if(_affected_rows()==1){
mysql_close();
_location('账号激活成功', 'login.php');
}else{
mysql_close();
_location('账号激活失败', 'register.php');
}
}else{
_location('账号激活失败', 'register.php');
}
}
参数没问题
解决方案 »
- PHP操作数据库排序问题
- 求php读取DBF的代码?
- php asp.net那个开发语言更好!
- Mysql 中 超大数据表 如何添加一个字段?
- php生成动态树形菜单一例(摘自网上asp论坛)
- php如何表示正整数?手册上怎么没有相关函数!
- PHP群,诚者加,不要潜水员
- 请教如何用PHP程序把服务器上的文件夹整个备分到本地PC里
- 请问php-4.0.1pl2-Win32.zip、mysql-3.23.19-beta-win.zip这两个文件的下载地址!
- 支付宝提交参数的时候地址栏乱码。
- 最近高考上头条这个东西很火,请问大家这东西怎样用php做出来的呢?
- 在centos中配置nginx支持php需要php-fpm,但我之前安装时没有指定php-fpm参数,安装后也没有php-fpm这个文件,应该如何安装?
_location('账号激活失败', 'register.php');但是数据库里还是被update了
最好在测试阶段 可以多加个数字.看看是怎么执行. 账号激活失败1 账号激活失败2 执行IF 就肯定不会执行ELSE. 也许是你的字面提示 迷乱了你吧
if(isset($_GET['action'])&&isset($_GET['active'])&&$_GET['action']=='ok'){
$_active=_mysql_string($_GET['active']);
if(_fetch_array("select tg_active from tg_user where tg_active='$_active' limit 1")){
//将tg_active设置为空
_query("update tg_user set tg_active=null where tg_active='$_active' limit 1");
}else{
_location('账号激活失败', 'register.php');
}
}结果还是激活失败 ,但是数据库中的数据已经更新