Is it bad to put a MySQL query in a PHP loop?

前端 未结 5 2063
庸人自扰
庸人自扰 2021-02-05 23:56

I often have large arrays, or large amounts of dynamic data in PHP that I need to run MySQL queries to handle.

Is there a better way to run many processes like INSERT or

5条回答
  •  别跟我提以往
    2021-02-06 00:32

    one thing to note about your original solution over the implosion method of jerebear (which I have used before, and love) is that it is easier to read. The implosion takes more programmer brain cycles to understand, which can be more expensive than processor cycles. premature optimisation, blah, blah, blah... :)

提交回复
热议问题