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.
这是我使用 PHP 进行 sql SELECT 的结果的日志:
224=[Array containing 1 elements] iProduct=[604]
其中 224 是行号。iProduct 是列标题
我该如何创建一个只包含返回值的变量(不是数组或任何东西)(即 $var = 604 在这种情况下)?
这里的基础知识有问题哈哈
如果使用 SQL,则不需要在脚本中进行排序。相反,应该使用数据库进行排序;因为它的排序速度比 PHP 能够做到的更快。例子:
SELECT colA, colB, colC FROM myTable WHERE colA = 'foo' ORDER BY colB DESC