Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用codeigniter,现在我正在做一个php循环(x100),在每个循环中我都做一个mysql查询,结果很好,1秒。但这是做这件事的好方法吗?我可以进行单个 mysql 查询并在带有一些循环的数组中找到结果,你认为这样会更好吗?
谢谢
没有代码可以给出真正的答案。但根据结果是否可重用或是否可以从 mysql 查询中获取多个结果,在 mysql 查询中执行循环可能会更好