My requirement is, i want to map some checklist values to some groups. following is my code @selectbox1 => contains the selected select groups @selectbox2 => contains selected checklist

foreach $select1(@selectbox1){ my $sql_select1 = "select id from group_management where group_name = +'$select1'"; my $box1 = $dbslave -> prepare($sql_select1); $box1 -> execute(); while($select_box1= $box1->fetchrow_array()) { push (@box1,$select_box1); } my $box_1 = @box1;// currently i tried like this to store the current +value .NEED CORRECTION HERE foreach $select2(@selectbox2) { my $sql_select2 = "select id from checklist where checklist_name = '$s +elect2'"; my $box2 = $dbslave -> prepare($sql_select2); $box2 -> execute(); while($select_box2 = $box2->fetchrow_array()) { push (@box2,$select_box2); } my $box_2 = @box2;// currently i tried like this to store the current +value .NEED CORRECTION HERE my $sql_insert = "insert into checklist_group_mapping values ('',$box_ +2,$box_1)"; my $ins = $dbslave -> prepare($sql_insert); $ins -> execute(); } }
how can i assign the current value of the array to a varible?so that i can insert it into mapping table

In reply to want to store the current value of the array ina variable inside for loop by gayu_justin

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.