Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by afoken (Chancellor)
on Dec 11, 2013 at 19:54 UTC ( [id://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". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-03-28 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found