我在表格中有超过1,20,000条记录
&安培;我必须取这些&触发那些记录的UPDATE查询
当我试图在一段时间后执行此活动时,它会暂停执行&出现“服务不可用”错误。
我已经取得了记录和在while循环中触发更新查询。
我的代码如下:
$sql_fetch_emails ="SELECT user_id,user_email_id FROM mytable GROUP BY REPLACE(user_email_id, '%40', '@') HAVING COUNT(*) < 2 AND user_email_id LIKE '%\%40%'";
$rs_fetch_emails = $con->db_query($sql_fetch_emails);
$get_records_count= $con->db_num_rows($rs_fetch_emails);
if($get_records_count>=1)
{
$i = 0;
while($user_email_rs = $con->db_fetch_array($rs_fetch_emails))
{
$user_id = $user_email_rs['user_id'];
$email_id = $user_email_rs['user_email_id'];
$update_qry = "UPDATE mytable SET user_email_id=REPLACE(user_email_id, '%40', '@') where user_id=".$user_id;
$con->db_query($update_qry);
$i++;
}
所以任何人都有解决这个问题的解决方案
请帮帮我