hi
i now still new for php , me now facing a problem like this
How to convert this sql statement into this array
SELECT SUM(RAW_AMOUNT) as TotalRawAmount, SUM(FG_AMOUNT) as TotalFGAmount, SUM(WIP) as TotalWIPAmount, UPLOAD_DATE FROM raw_fg_sum GROUP by UPLOAD_DATE";

how to store data into to this multi array

UploadDate 19/2/2007 21/3/08 2/1/2008 4/3/2008
0TotalRawAMount 1000 2011 1111 2333
1TotalFGAmount 212 122 21 21
2TotalWIPAmount 212 122 21 211

$arrData[0][1] = "TotalRawAmount";
$arrData[1][1] = "TotalFgAmount";
$arrData[2][1] = "TotalWIPAmount";
data for TotalRawAmount
$arrData[0][2] = 1000;
$arrData[1][2] = 2011;
$arrData[2][2] = 1111;
$arrData[3][2] = 2333;
// Dara for TotalFGAmount
$arrData[0][3] = 212;
$arrData[1][3] = 122;
$arrData[2][3] = 21;
$arrData[3][3] = 21;
// Data for TotalWIGAmount
$arrData[0][3] = 212;
$arrData[1][3] = 122;
$arrData[2][3] = 211;
$arrData[3][3] = 21;
DataFOr UPload_date
$arrDate[1][1]=UPloadDate
$arrDate[1][2]=19/2/07
$arrDate[1][2]=21/3/08
$arrDate[1][2]=2/1/08
$arrDate[1][2]=4/3/08


thanks

sorry like this array format

19/2/2007 21/3/08 2/1/2008 4/3/2008 <--UPLOAD_DATE
TotalRawAMount 1000 2011 1111 2333
TotalFGAmount 212 122 21 21
TotalWIPAmount 212 122 21 211
$arrData[0][0] =""
$arrData[1][0] = "TotalRawAmount";
$arrData[2][0] = "TotalFgAmount";
$arrData[3][0] = "TotalWIPAmount";
data for TotalRawAmount
$arrData[1][1] = 1000;
$arrData[1][2] = 2011;
$arrData[1][3] = 1111;
$arrData[1][4] = 2333;
// Dara for TotalFGAmount
$arrData[2][1] = 212;
$arrData[2][2] = 122;
$arrData[2][3] = 21;
$arrData[2][4] = 21;
// Data for TotalWIGAmount
$arrData[3][1] = 212;
$arrData[3][2] = 122;
$arrData[3][3] = 211;
$arrData[3][4] = 21;
DataFOr UPload_date
$arrDate[0][1]=19/2/07
$arrDate[0][2]=21/3/08
$arrDate[0][3]=2/1/08
$arrDate[0][4]=4/3/08


thanks

<?php
//connect
//select db
$arrData=array();
$query="SELECT SUM(RAW_AMOUNT) as TotalRawAmount, SUM(FG_AMOUNT) as TotalFGAmount, SUM(WIP) as TotalWIPAmount, UPLOAD_DATE FROM raw_fg_sum GROUP by UPLOAD_DATE";
$result=mysql_query($query);
$arrData[0][0] ="";
$arrData[1][0] = "TotalRawAmount";
$arrData[2][0] = "TotalFgAmount";
$arrData[3][0] = "TotalWIPAmount";
$i=1;
while($row=mysql_fetch_array($result)){
	$arrData[0][$i]=$row['UPLOAD_DATE'];
	$arrData[1][$i]=$row['TotalRawAmount'];
	$arrData[2][$i]=$row['TotalFgAmount'];
	$arrData[3][$i]=$row['TotalWIPAmount'];
        $i++;
}
print_r($arrData); //$arrData will have the array in the format you have specified.
?>

Hope that helps.
Nav

Thank for u help
This is exactly i need, it help me alot.
If i got any question i will ask u again
Thanks

This question has already been answered. Start a new discussion instead.