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.
The bug was this line:
The fix is: