Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 5th, 2000, 05:19 PM
petew00 petew00 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 4 petew00 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm trying to create a graph with 'GD::Graph::lines'. To get the job done I need to fill a variable like this:

@data = (
[qw(09:00 09:05 09:10 09:15)],
[ (1.0, 1.4, -0.9, -0.4)],
);

When I fill in these example-values in the perl-script itself, it works fine and a nice graph is created.

However, my data are in a mysql-database, so I have to get them out of the database and into the variable '@data' in the required format (see above). One of the (many) things I tried, is to use a 'push' like this (in accordance with the PERLLOL(1)-manpage):

while (@row = $sth->fetchrow_array) {
push @data, $LoL["$time"][$value];
}

the $time and $value that are passed this way are:

09:00 1.0
09:05 1.4
09:10 -0.9
09:15 -0.4

It doesn't work! The module reports:
'Argument "09:00" isn't numeric in aelem at sample.pl line 40'. I think the variables are not passed into '@data' in the right order.

Can anyone tell me how I can fetch the data into the variable '@data' as required by the 'GD::Graph::lines'-module?

Thnx in advance...

Reply With Quote
  #2  
Old September 6th, 2000, 06:46 AM
MeijdenB MeijdenB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Location: Alkmaar, The Netherlands
Posts: 123 MeijdenB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>It doesn't work! The module reports:
'Argument "09:00" isn't numeric in aelem at sample.pl line 40'.
[/quote]

I've got to questions:

1. Could it be that 09:00 is a date/time value and needs to be parsed to a numeric value?

2. Could it be that 09:00 is regarded as a string in stead of a numeric value?

These are just 2 slips of my mind.

------------------
Good luck,
Bas

------------------
E-mail me at: b.vandermeijden@pecoma.nl

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Fetching data into 'Lists of lists': HELP!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway