I got a sql query that i just added new where clause and when i added that clause it stops fetching anything and if i copy the sql query and run it from program its working fine.
SELECT P.PROPS, P.DT_CHANGED, PI.KOLICH, S.TEGLO,S.CENA_PROD_ED1, PI.STOKA, P.DATETIME
FROM PRODAWA P
LEFT JOIN PRODAWA_ITEMS PI ON (P.DATETIME = PI.DATETIME)
LEFT JOIN STOKI_DEF S ON (PI.STOKA = S.STOKA)
WHERE P.DT_CHANGED BETWEEN '.$begindate.' AND '.$enddate.' AND P.FACTUR_BY = \'“ВЛАДИ “ ООД\' AND P.PROPS > 0 ORDER BY P.DT_CHANGED ASC
if i remove the clause P.FACTUR_BY It starts working.