i'm having a strange problem over here.
while the following code does properly work on my localhost (while developing), the 'real' host hangs itself up.
i thought it could be something wrong with the select-statement, yet all the other statements do work fine.
it could be something with the amount of the returned rows. < 20 rows do work fine, >20 only 'sometimes'.

what am i asking you for? could any expert monk out there (maybe it doesn't even take an expert) tell me if there's something wrong with the code? and/or what else could be the problem that it works fine on my localhost, but not 'over the net'? could something be wrong with the foreach? do i eat up the memory? i do not know.

the code does the following:
printing a dropdown with the available elements on the database. if you select one, it reads only this element and shows the content in a simple web-form (not shown here).
my ($head, $where, $titel, $text, $titel_e, $text_e, $url, $type); my @update; my @elementlist = Statements::doSelect("element_id,element_titel","t +_element"); print qq( <form action="$Constants::cgi/admin.pl?act=1" method="POST"> <select name="eid" onChange="submit()"> <option value="">Neues Element einf\374gen</option> ); foreach my $foo (0..$#elementlist) { my $selected; if ($list{'eid'} == $elementlist[$foo][0]) { $selected = "selected"; } print qq( <option value="$elementlist[$foo][0]" $selected>$elementlist +[$foo][1]</option> ); } print qq( </select><br/> ); if ($list{'eid'}) { $where = "element_id = $list{'eid'}"; @update = Statements::doSelect("element_id,element_titel,element +_text,element_titel_e,element_text_e,URL,element_type","t_element",$w +here); ($titel, $text, $titel_e, $text_e, $url, $type) = ($update[0][1] +,$update[0][2],$update[0][3],$update[0][4],$update[0][5],$update[0][6 +]); $head = "$titel ändern"; } else { $head = "Neues Element einfügen"; }

thank you guys.

update:
i post the code of the doSelect-function, since that's the piece which sets up the sql-statement.
# ----------------------------------------------------------------- # Name : doSelect(). # Description : select values from db # Recieves : SELECT, FROM, WHERE, ORDER, GROUP # Returns : selected values # ----------------------------------------------------------------- sub doSelect { my (@res, @row, $i); my ($select, $from,$where,$group,$order); $select = "SELECT $_[0] "; $from = "FROM $_[1] "; if ($_[2]) { $where = "WHERE $_[2] "; } if ($_[3]) { $group = "GROUP BY $_[3] "; } if ($_[4]) { $order = "ORDER BY $_[4] "; } my $sql = $select . $from . $where . $group . $order; #print $sql; my $sth = DBKomm::connectdb($Constants::dbsrc,$Constants::dbuser,$Cons +tants::dbpasswd)->prepare( $sql ); if ($sth) { $sth->execute; while (my @row = $sth->fetchrow_array) { $res[$i++] = [@row]; } $sth->finish; } else { print "nothing here to do and say"; } DBKomm::disconnectdb(); return @res; }

In reply to host does not respond; sometimes by zetetes

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.