It just does not print the @Geo_areas after it should be full with the content of the select statement.

<not_entirely_tongue_in_cheek> Of course not, as there is no print statement in the code you showed us :p </not_entirely_tongue_in_cheek>

My guess is that your $Special_data_retrieval variable isn't correctly formed, and so your query is returning zero rows. Try adding a print "$Select_areas\n"; before the query is executed, and then test it manually.

Also, be aware that selectrow_array fetchrow_array will only give you a single row of data. So if you are expecting multiple rows then it would generally be contained within a while loop. Yes, I know you mentioned a while loop in your original post, but you indicated that the whole code snippet is within a while loop. And that isn't what I mean. What you probably need is something like this:

while (my @row = $sth_Geo->fetchrow_array) { print "@row\n"; # Or whatever }

If you want to grab the whole lot in one go, then you probably want to use selectall_arrayref fetchall_arrayref

Cheers,
Darren :)


In reply to Re^3: my @Array = $sth->fetchrow_array; by McDarren
in thread my @Array = $sth->fetchrow_array; by Win

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.