0

我尝试同时执行许多查询,但大约需要 1-2 分钟才能崩溃。我也尝试最大限度地执行但使用 set_time_limit(120)它仍然崩溃。我见过mysqli_multi_query会是一个不错的选择,但我不知道它是否适合我的。

    mysql_query("UPDATE `lotto_gameplay` SET `six_digit_result`=1 WHERE EXISTS ( SELECT `lotto_main`.*,`lotto_gameplay`.* FROM `lotto_main` WHERE `lotto_main`.`lotto_num` = `lotto_gameplay`.`six_digit`  AND `lotto_main`.`postdate`='".$datt."'AND `lotto_main`.`lotto_type`='0' AND `lotto_gameplay`.`status`='0' )");

    mysql_query("UPDATE `lotto_gameplay` SET `six_digit_result`=2 WHERE EXISTS ( SELECT `lotto_main`.*,`lotto_gameplay`.* FROM `lotto_main` WHERE `lotto_main`.`lotto_num` = `lotto_gameplay`.`six_digit`  AND `lotto_main`.`postdate`='".$datt."'AND `lotto_main`.`lotto_type`='3' AND `lotto_gameplay`.`status`='0')");

    mysql_query("UPDATE `lotto_gameplay` SET `six_digit_result`=3 WHERE EXISTS ( SELECT `lotto_main`.*,`lotto_gameplay`.* FROM `lotto_main` WHERE `lotto_main`.`lotto_num` = `lotto_gameplay`.`six_digit`  AND `lotto_main`.`postdate`='".$datt."'AND `lotto_main`.`lotto_type`='4' AND `lotto_gameplay`.`status`='0')");


    mysql_query("UPDATE `lotto_gameplay` SET `six_digit_result`=4 WHERE EXISTS ( SELECT `lotto_main`.*,`lotto_gameplay`.* FROM `lotto_main` WHERE `lotto_main`.`lotto_num` = `lotto_gameplay`.`six_digit`  AND `lotto_main`.`postdate`='".$datt."'AND `lotto_main`.`lotto_type`='5' AND `lotto_gameplay`.`status`='0')");

    mysql_query("UPDATE `lotto_gameplay` SET `six_digit_result`=5 WHERE EXISTS ( SELECT `lotto_main`.*,`lotto_gameplay`.* FROM `lotto_main` WHERE `lotto_main`.`lotto_num` = `lotto_gameplay`.`six_digit`  AND `lotto_main`.`postdate`='".$datt."'AND `lotto_main`.`lotto_type`='6' AND `lotto_gameplay`.`status`='0')");

    mysql_query("UPDATE `lotto_gameplay` SET `six_digit_result`=6 WHERE EXISTS ( SELECT `lotto_main`.*,`lotto_gameplay`.* FROM `lotto_main` WHERE `lotto_main`.`lotto_num` = `lotto_gameplay`.`six_digit`  AND `lotto_main`.`postdate`='".$datt."'AND `lotto_main`.`lotto_type`='7' AND `lotto_gameplay`.`status`='0')");
4

0 回答 0