[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Thu Jan 27 23:33:17 2005 -->
- <!--x-from-r13: wxvaarl ng ybpnyargfbyhgvbaf.pbz (Xnzrf B. Yvaarl WWW) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] brain damaged perl DBI -->
- <li><em>date</em>: Thu Jan 27 23:33:17 2005</li>
- <li><em>from</em>: jkinney at localnetsolutions.com (James P. Kinney III)</li>
- <li><em>in-reply-to</em>: <<a href="msg01242.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg01242.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] brain damaged perl DBI</li>
Arrggh.
On Thu, 2005-01-27 at 22:36 -0500, James P. Kinney III wrote:
> This *&%*^ chunk of perl is not returning anything from the database. Is
> there something stupid I have missed (The data is there. A psql query
> return two lines which is correct. It does connect to the database as I
> copied the connection params from another working area).
>
> # connect to database
> my $dbh = $form->dbconnect($myconfig);
> my $id_start = $form->{id};
> my @clone_list;
> my %clone_test;
> push @clone_list, $id_start;
> $clone_test{$id_start} = 1;
> foreach my $id (@clone_list){
> my $query = qq|SELECT id
> FROM assembly
> WHERE parts_id = $id|;
> my $sth = $dbh->prepare($query);
> $sth->execute || $form->dberror($query);
> my $ref;
> while ($ref = $sth->fetchrow_arrayref){
> my $cloneid = [ @$ref ];
> if ((! $clone_test{$cloneid}) && ($cloneid !~ $id_start)){
> push @clone_list, $cloneid;
> $clone_test{$cloneid}=1;
> }
> }
> $sth->finish;
> }
> $dbh->disconnect;
> open (OUT, ">/tmp/out.IC")||die "$!\n";
> my $line = join ', ', @clone_list;
> print OUT "clone_list = $line\n";
> close OUT;
> push @{ $form->{clone_list}}, @clone_list;
>
>
> The file /tmp/out.IC gets only "clone_list = 0" ?!?!?!
>
> I added prints to the while ($ref.....) block and got nothing. If I add
> a die in the while block, it dies at that point. so I know it's running.
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
>
> !DSPAM:41f9b37396931623319817!
--
James P. Kinney III \Changing the mobile computing world/
CEO & Director of Engineering \ one Linux user /
Local Net Solutions,LLC \ at a time. /
770-493-8244 \.___________________________./
<a rel="nofollow" href="http://www.localnetsolutions.com">http://www.localnetsolutions.com</a>
GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="01242" href="msg01242.html">[ale] brain damaged perl DBI</a></strong>
<ul><li><em>From:</em> jkinney at localnetsolutions.com (James P. Kinney III)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01243.html">[ale] accessing my linux box from a windows machine</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01245.html">[ale] Problem Installing Suse 9.2</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01242.html">[ale] brain damaged perl DBI</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01253.html">[ale] brain damaged perl DBI</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01244"><strong>Date</strong></a></li>
<li><a href="threads.html#01244"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>