Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: execute failed: called with 2 bind variables when 0 are needed

by afoken (Prior)
on Dec 11, 2013 at 19:54 UTC ( #1066697=note: print w/ replies, xml ) Need Help??


in reply to Re: execute failed: called with 2 bind variables when 0 are needed
in thread execute failed: called with 2 bind variables when 0 are needed

change $sth->execute(1, 10); to $sth->execute();

Please don't. Placeholders prevent SQL injections and allow caching of prepared statements, so:

  1. Change the value "E" in $sql to a single, unquoted ?
  2. Change the execute parameters to ("E")

More information: DBI, Bobby Tables, Re: Counting rows Sqlite, Re^2: Massive Memory Leak, Re^5: Variable interpolation in a file to be read in.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)


Comment on Re^2: execute failed: called with 2 bind variables when 0 are needed
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (16)
As of 2015-07-07 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (90 votes), past polls