Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Problem in perl/tk

by Pope-O-Matik (Pilgrim)
on Nov 29, 2015 at 14:19 UTC ( [id://1148812]=note: print w/replies, xml ) Need Help??


in reply to Problem in perl/tk

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1148812]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-25 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found