dongwei7913 2011-08-18 06:09
浏览 32
已采纳

在循环中跳过错误? (PHP)

I have a loop where the code loops and in every loop it connects to different server and then makes MySQL query. However sometimes one of the loops/queries cannot reach to the end and all the code breaks. Is there a way where if the loop gives error then skip the processes / move to next loop?

  • 写回答

4条回答 默认 最新

  • douhuanglou1445 2011-08-18 06:24
    关注

    As stated in the comments above, the correct way to do this is within a try...catch block.

    To learn more about these, you can read about them here.

    Thanks @Paul.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?