in reply to Need help with DBI bind value error
There I've moved $grp_name out of the SQL and moved into the execute() and replaced it with a placeholder. For more info on placeholders see the Placeholders and Bind Values section of the DBI docs.my $sqlcount = 'SELECT COUNT(*) FROM grp_def WHERE grp_name = ?'; my $sth = $dbh->prepare($sqlcount) or die "Cannot prepare: " . $dbh->errstr(); $sth->execute($grp_name) or die "Cannot execute: " . $sth->errstr(); my $occurences = $sth->fetchrow_arrayref->[0]; print "result: $occurences\n";
_________
broquaint
|
|---|