in reply to Need help with DBI bind value error
The above answers are all very much right in identifying the problem as your usage of place-holders. One other minor point about your program design that might help you: you pass param('grp_name') to DBI without checking its validity or existence. If that parameter is undefined, you will get an error (actually, the same one you got here but with the numbers reversed. You might want to consider doing something as simple as this:
Or you could get more complicated and check the validity of param('grp_name') with an appropriate reg-ex. In short: it's usually a good idea to validate your parameters before passing them to the database.my $grp_name = param('grp_name'); if (exists($grp_name)) { $sth->execute($grp_name); }
|
|---|