Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Maybe I should also elaborate where I get the data from. This is how the data is fetched and proccessed:
# In the main script: my @ReturnValues; my @AdminValues; my @AdminTime; my @AdminEndDate; Admin(\@ReturnValues, \@AdminValues, \@AdminTime, \@AdminEndDate); # This is the code in sub Admin: my $sql = "SELECT DISTINCT user_id, realname FROM database.time_data W +HERE version='$Version' AND product_id='$ProductID' AND milestone='$M +ileStone'"; my $sth = $dbh->prepare($sql); $sth->execute(); while(my @RowAdmin = $sth->fetchrow_array()) { my %AdminData; $AdminData{"UserID"} = $RowAdmin[0]; $AdminData{"RealName"} = $RowAdmin[1]; # Insert them into hash push (@$AdminValues, \%AdminData); } # Get the stored days $sql = "SELECT DISTINCT day FROM database.time_data WHERE version='$Ve +rsion' AND product_id='$ProductID' AND milestone='$MileStone'"; $sth = $dbh->prepare($sql); $sth->execute(); while(my @RowTime = $sth->fetchrow_array()) { my %AdminTimeData; $AdminTimeData{"Day"} = $RowTime[0]; push (@$AdminTime, \%AdminTimeData); my $sql2 = "SELECT app_end FROM database.time_data WHERE day='$AdminTi +meData{'Day'}' AND version='$Version' AND product_id='$ProductID' AND + milestone='$MileStone'"; my $sth2 = $dbh->prepare($sql2); $sth2->execute(); while(my @RowTime2 = $sth2->fetchrow_array()) { my %AdminAppEnd; $AdminAppEnd{"AppEnd"} = $RowTime2[0]; push (@$AdminEndDate, \%AdminAppEnd); } } $sth->finish(); $dbh->disconnect(); # Back in the main script: # Pass Values to template $vars->{'ReturnValues'} = \@ReturnValues; $vars->{'AdminValues'} = \@AdminValues; $vars->{'AdminTime'} = \@AdminTime; $vars->{'AdminEndDate'} = \@AdminEndDate;
How the data is then proccessed in the template can be seen in the first Post. I hope this helps a bit. Regards Fred

In reply to Re^3: How to skip certain values in a foreach loop by Frederic_S
in thread How to skip certain values in a foreach loop by Frederic_S

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-24 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found