T
Thomas Becker
Hey guys,
I've to read out some rows of some mysql db. No problem at all.
But I've to seperate the results for different machines.
So I tried the following:
while (@data = $sth->fetchrow_array()){
push @$i_date, $data[0];
push @$i_totalmem, $data[1];
push @$i_residentmem, $data[2];
push @$i_sharedmem, $data[3];
push @$i_privatemem, $data[4];
push @$i_cpu, $data[5];
push @$i_connections, $data[6];
}
Surely it does not work. How can I give the arrays names containing
$i?
And then I want to create some Graphs using GD:Graph (nice module).
How can I access every of the arrays created above seperately?
Again I tried something stupid:
foreach $i (@welo){
$my_graph->set_legend("$i_totalmem","$i_residentmem","$i_sharedmem","$i_privatemem","$i_cpu","$i_connections");
$gd = $my_graph->plot([\@$i_date, \@$i_totalmem,
\@$i_residentmem, \@$i_sharedmem, \@$i_privatemem, \@$i_cpu,
\@$i_connections])
or die $my_graph->error;
}
Surely it doesn't work at all.
Can someone give me a clue? I do not get this done by myself. I've got
no clue.
Thx ALOT, Thomas
I've to read out some rows of some mysql db. No problem at all.
But I've to seperate the results for different machines.
So I tried the following:
while (@data = $sth->fetchrow_array()){
push @$i_date, $data[0];
push @$i_totalmem, $data[1];
push @$i_residentmem, $data[2];
push @$i_sharedmem, $data[3];
push @$i_privatemem, $data[4];
push @$i_cpu, $data[5];
push @$i_connections, $data[6];
}
Surely it does not work. How can I give the arrays names containing
$i?
And then I want to create some Graphs using GD:Graph (nice module).
How can I access every of the arrays created above seperately?
Again I tried something stupid:
foreach $i (@welo){
$my_graph->set_legend("$i_totalmem","$i_residentmem","$i_sharedmem","$i_privatemem","$i_cpu","$i_connections");
$gd = $my_graph->plot([\@$i_date, \@$i_totalmem,
\@$i_residentmem, \@$i_sharedmem, \@$i_privatemem, \@$i_cpu,
\@$i_connections])
or die $my_graph->error;
}
Surely it doesn't work at all.
Can someone give me a clue? I do not get this done by myself. I've got
no clue.
Thx ALOT, Thomas