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.
是否有任何有效的方法来检查 mysqli 的 fetch 循环是否不会运行(因为查询返回一个空表)?
while ($sql->fetch()) { // ... something } if (sql fetch returned empty array) { // ... } else { // ... }
我应该自己实现这个还是mysqli有任何预先制定的声明来做到这一点?