Aside from the best practices that have already been suggested, and that you should follow, there is one thing that at first glance indicate a point of failure. You are trying to build your query based on the values that those $a_* variables have. But you are passing them inside single quotes, and what goes inside single quotes is not interpolated. So, what you are really trying to insert is what you actually can read on that line of code, not the values of the variables.
Also, instead of the custom error message, use the one DBI gives you with DBI->errtsr
update: Thanks Crackers2 and Narveson, you are absolutely right. Please ignore this post.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.