PHP 查询结果的数量与 Oracle Toad 的终端结果不匹配
我得到了修复,但我需要解释原因,并将其作为其他人的参考:
问题是我们得到了这个视图,比如说 A,它是建立在另一个视图 B 之上的。如果你从视图 A 中执行 select *,你得到说 37 条记录。太好了,现在如果您通过 PHP adobdb 运行它,它会为您提供 525 条记录!
事实证明,之所以会发生这种情况,多亏了我的同事,是因为视图 B 有这条时髦的行,PHP 会忽略,但 TOAD 不会:
AND p.created_on > TO_DATE ('23-SEP-10')
修复方法是:
AND p.created_on > TO_DATE ('2010/09/23', 'YYYY/MM/DD')
摘要: 如果您的 php 查询结果与您的终端结果不匹配,请尝试此解决方案。
I got the fix but I need the explanation why and leaving this as a references for other people:
The Problem is we got this view, say A, that is built upon another view B. If you do a select * from view A, you get say 37 records. Great, now if you run this via PHP adobdb, it gives you 525 records!
The reason why this happened as it turns out, thanks to my coworkers, is because view B have this funky line that PHP ignores but TOAD doesn't:
AND p.created_on > TO_DATE ('23-SEP-10')
The fix was:
AND p.created_on > TO_DATE ('2010/09/23', 'YYYY/MM/DD')
Summary:
If your php query results does not match your terminal results then try this solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
错误是这一行:
修复是:
The bug was this line:
The fix is: