Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
It connects properly to the database but @swearwords contains none of the stores swear words. I know they're in the database because my other script can read them different. I can't get the array to hold them though.my $data = qq(SELECT word FROM swearwords); my $sth = $dbh->prepare($data); $sth->execute() or die $dbh->errstr; while(my $ref = $sth->fetchrow_arrayref) { push @swearwords, $ref->[0]; }
Did I do something wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: creating an array from MySQL results
by rnahi (Curate) on Oct 30, 2005 at 19:21 UTC | |
|
Re: creating an array from MySQL results
by pg (Canon) on Oct 30, 2005 at 19:24 UTC | |
|
Re: creating an array from MySQL results
by Juerd (Abbot) on Oct 30, 2005 at 21:34 UTC |