![]() |
1
1
Daniel's solution is likely to be the cleanest solution, but I get your point about performance. I'm not very familiar with PHP, but there should be some db abstraction library that takes care relations and multiple inserts so that you get the best performance, right? I only mention it because there may not be a real performance issue. DO you have load tests that point to an issue perhaps? Anyway, if it is between your original 2 solutions, I would have to select the first. Having a table with column names (like your solution #2) is just asking for trouble. If you add new params, you have to modify the table columns. And there is the ever present issue of " 我们用什么来表示未选中vs左空? “ 所以我不同意解决方案2更干净。 |
![]() |
2
1
您可以有一个由三列组成的表:
如果你愿意,你也可以
|
![]() |
3
1
Well that's completely dependent on what you want to do with the data. For the PHP part, you need to process it anyway, either on insertion or selection time. For really large number of parameters you may save some time with the 1st on the database management/maintenance, since you don't need to change anything about your database scheme. Daniel's answer is a generic solution, but if you consider performance an issue, you may end up doing too many inserts on the database side for a single search (one for each parameter). Too many inserts is a common source of performance problems. 你知道你的资源。 |
![]() |
Jacco · 未能格式化我的日期以在php中正确工作 1 年前 |
![]() |
jay ram · 如何在URL核心php中从API获取JSON? 1 年前 |
|
Ishwarya A · php电子表格在浏览器中显示多张excel 1 年前 |