insert into tmp(user_id,result,right_count,wrong_count,total,score) select user_id,result,right_count,wrong_count,total,score from user_exam where exam_id = $examid group by score,right_count; 这句肯定没错了吧?phpmyadmin中执行后的确在tmp表中插入了记录。但是在php网页中执行还是不行
代码没错! if (!mysql_query($sql, $db)) { echo "error!".mysql_error(); exit; } 贴出结果
这个是正解
这句肯定没错了吧?phpmyadmin中执行后的确在tmp表中插入了记录。但是在php网页中执行还是不行
if (!mysql_query($sql, $db))
{
echo "error!".mysql_error();
exit;
}
贴出结果