go ahead... be a heretic | |
PerlMonks |
Re: Problem in perl/tkby Pope-O-Matik (Pilgrim) |
on Nov 29, 2015 at 14:19 UTC ( [id://1148812]=note: print w/replies, xml ) | Need Help?? |
SELECT * FROM university WHERE ID = $ID A couple side points. 1) * should only be used in COUNT(*), EXISTS(SELECT * ...), and ad-hoc queries. Elsewhere, the column list ought to be specified. This is self-documenting and protects against column changes and reordering. 2) Please do not use dynamic SQL. It is insecure, and sometimes, not as efficient. It's easy to use a placeholder. Just replace $ID with a question mark (?) and pass the variable in the execute() statement. The foreach can still be used, just have it place question marks instead, and load an array to be used for the execute statement.
In Section
Seekers of Perl Wisdom
|
|