Also, look into the RaiseError attribute and you can avoid having to explicitly print out errstr(). update: added RaiseError attribute to code. Oh yeah ... select * is bad news, especially when using fetchrow_hashref ... you should always spell out the names of the columns you want returned.use strict; use DBI; my $dbh = DBI->connect( 'DBI:mysql:CLTE', {RaiseError=>1} ); my $sql = " SELECT * FROM clttable WHERE clt LIKE ? "; my $sth = $dbh->prepare($sql); $sth->execute($INPUT{clt} . '%'); my $row = $sth->fetchrow_hashref; $sth->finish; $dbh->disconnect;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to (jeffa) Re: DBI and MySQL wild card function?
by jeffa
in thread DBI and MySQL wild card function?
by perleager
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |