On Wed, 2005-03-09 at 11:03 +0500, Adam Saeed wrote:
> hi i am some new to per;.
> I want to get a day numbers by year and store them in e a 2 -d array,
> getting data from mysql. i.e data[dayofyear][year] ....BUT I COULD NOT
> GETTING THE DESIRE RESULT ... ANY HELP my snap code is:
> ...
> ...
> 
> @year  #have list of years
> my $i=0;
> my @dayofyear=([],[]);
> my @data=([],[]);
> my $old;
> for $i (0 .. $yrtot)
> {
> $old = $dbh->prepare("SELECT
> distinct(dayofyear(from_unixtime(datetime))) FROM table where
> year(from_unixtime(datetime))='$year[$i]'");
>   $old->execute();
>   while (@dayofyear = $old->fetchrow_array())
>         {
>          push (@data,@dayofyear);
>          }
> }
> 
> ----
> Regards,
> Adam Saeed
> [EMAIL PROTECTED]
> 

Actually what you want to do is read about Data Structures, check
perldoc perldsc and recommended: perlreftut and perlref.

Regards,

-- 
Marco Antonio Manzo Bañuelos
[EMAIL PROTECTED]
http://www.unixmonkeys.com/amnesiac/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to