Help with array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello
Working with jpGraph Gnatt Graph
Sample gnatt files shows data array as follows:
$data = array(
array(0,"Concept","2002-9-1","2002-9-15",blue),
array(1,"Creative","2002-9-15","2002-9-30",red),
array(2,"Produce","2002-9-31","2002-10-10",green)):

Output $data looks like this:
0: 0
1: Concept
2: 2002-9-1
3: 2002-9-15
4: blue
0: 1
1: Creative
2: 2002-9-15
3: 2002-9-30
4: red
0: 2
1: Produce
2: 2002-9-31
3: 2002-10-10
4: green

I want to create this $data array thru mySQL sql
The routine I have used on other graphs:

$query = "order, task ,DATE_FORMAT(start, '%Y-%m-%d'),DATE_FORMAT(end,
'%Y-%m-%d'), color
FROM timeline WHERE jobnu = 8648
$result = mysql_query ($query);
$cpt=0;
while($row = mysql_fetch_row($result))
{
$data[$cpt]= $row[0].",".$row[1].",".$row[2].",".$row[3].",".$row[4];
$cpt++;
}

Output $data
0,Concept,2002-9-1,2002-9-15,blue
1,Creative,2002-9-15,2002-9-30,red
2,Produce,2002-9-31,2002-10-10,green
etc....

How can I create the array (in an array ??) show in the sample
$data thru my SQL query ??

thanks
jrt




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux