我在表中有超过 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++;
}
所以任何人都有解决这个问题的解决方案
请帮我