|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re^2: Quickest way of fetching a Single row and column in MySQL using DBIby cees (Curate) |
| on Aug 06, 2006 at 21:04 UTC ( [id://565881]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Although your version works, it is potentially open to an SQL injection attack through the $username variable. With DBI that is easy to avoid by using placeholders. Also, I think you want selectrow_array (selectrow_arrayref returns a reference to an array, wheras selectrow_array will return a list, or just a scalar value if you are selecting a single column).
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||