in reply to Having issues with DBI
It helps to you to see warnings and errorsmy $dbh = DBI->connect("DBI:mysqlPP:host=localhost;database=foo",'bar' +,'baz',{ AutoCommit => 1, RaiseError => 1, PrintErrors=>1}) or die "C +annot connect"; ... some stuff... foreach my $color (@color){ # trim whitespace $color =~ s/^\s+|\s+$//gm; # see if the color already exists in the color table. my $rowCheckQuery = qq{SELECT color_id FROM color W +HERE color=?}; my $sth = $dbh->prepare($rowCheckQuery); $sth->bind($color); $sth->execute() or die $dbh->errstr; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Having issues with DBI
by zoophagous (Novice) on Dec 11, 2008 at 16:21 UTC | |
by perrin (Chancellor) on Dec 11, 2008 at 18:42 UTC | |
by zoophagous (Novice) on Dec 11, 2008 at 19:16 UTC | |
by perrin (Chancellor) on Dec 11, 2008 at 19:47 UTC | |
by zoophagous (Novice) on Jan 03, 2009 at 05:12 UTC | |
by woodpeaker (Novice) on Dec 11, 2008 at 18:30 UTC |