Sorry guys for the silly question, but I am encountering an strange problem. The code used to work with php 5.2 but I have moved to 5.5 and it is not working.
Anyways I ma trying to retrieve data from database and pushing in an array. The query is displaying correct data but not working in array. This is my code
$data = array();
$mm = array();
$m = array();
$y = array();
$years = array();
$f = array();
$facts = array();
$i = 0;
$g = array();
$groups = array();
$r = array();
$regions = array();
$import = array();
$imports = array();
$colcount = 0;
$sumunits=0;
$sumvalue=0;
$sumasp=0;
while($d = mysql_fetch_array($getdata))
{
if($i > 0)
{
array_push($mm, $month, $units, $value, $asp);
$colcount++;
array_push($m, $mm);
$mm = array();
if($year != $d['data_year'] || $fact != $d['data_fact'] || $region != $d['data_region'] || $importtime != $d['importtime'])
{
array_push($y, $year, $m);
array_push($years, $y);
$m = array();
$y = array();
}
if($fact != $d['data_fact'] || $group != $d['fact_group'] || $region != $d['data_region'] || $importtime != $d['importtime'])
{
array_push($f, $factname, $years, $oldlabel, $order);
array_push($facts, $f);
$f = array();
$years = array();
$colcount = 0;
}
}
$i++;
}
array_push($mm, $month, $units, $value, $asp);
array_push($m, $mm);
if($year != $d['data_year'])
{
array_push($y, $year, $m);
array_push($years, $y);
$m = array();
$y = array();
$colcount++;
}
if($fact != $d['fact_id'])
{
array_push($f, $factname, $years, $oldlabel, $order);
array_push($facts, $f);
$f = array();
$years = array();
}
It was working with php 5.2 but not working on php 5.5, Please help me guys.
Thank you
array_push? it shouldnt wont work just because ofarray_pusharray_push, it shouldn't influence your results. @Andrew well...this is strange.