How many MySQL queries should I limit myself to on a page? PHP / MySQL

后端 未结 10 1378
春和景丽
春和景丽 2020-12-10 13:16

Okay, so I\'m sure plenty of you have built crazy database intensive pages...

I am building a page that I\'d like to pull all sorts of unrelated database informati

10条回答
  •  醉话见心
    2020-12-10 13:29

    As other have said, there is no single number. Whenever possible please use SQL for what it was built for and retrieve sets of data together.

    Generally an indication that you may be doing something wrong is when you have a SQL inside a loop.

    When possible Use joins to retrieve data that belongs together versus sending several statements.

    Always try to make sure your statements retrieve exactly what you need with no extra fields/rows.

提交回复
热议问题