I need to run a query and save the values in a PHP array. So that in the later time, I could pass the array into json and even run sizeof() for data manipulation. so far my query is this,
WITH DATA
AS (SELECT TO_DATE ('2012-01-02', 'YYYY-MM-DD') date1,
TO_DATE ('2012-02-20', 'YYYY-MM-DD') date2
FROM DUAL)
SELECT TO_CHAR (date1 + LEVEL - 1) datename,
TO_CHAR (date1 + LEVEL - 1, 'fmMonth') month_name,
TO_CHAR (date1 + LEVEL - 1, 'IW') the_week,
TO_CHAR (date1 + LEVEL - 1, 'D') the_day,
TO_CHAR (date1 + LEVEL - 1, 'DAY') the_day_name
FROM data
CONNECT BY LEVEL <= date2 - date1 + 1
and the php is,
$days = array();
while ($row = oci_fetch_array($dateHeaderParse)){
$days = $row['THE_DAY'];
}
?>
and when i execute withthis,
print_r($days);
its only returning two, which supposed to be more than two. The query is perfectly working.
Please help me
$days = $row['THE_DAY'];- shouldn't it bearray_push($days, $row['THE_DAY']);?