Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Do you know where your variables are?
 
PerlMonks  

Re: DBI reports too many bind variables

by dbwiz (Curate)
on May 24, 2005 at 16:29 UTC ( [id://460155]=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.


in reply to DBI reports too many bind variables

In addition to the useful advice of escaping your pipe character, I would also advise you to code defensively. i.e. check your data before passing it to the "execute" method.

my @player_rec = split /\|/; if (scalar(@player_rec) == scalar(@fields)) { if ($sth->execute(@player_rec)) { print "Worked, cool"; } else { print "Didn't work, uncool, error is: $DBI::errstr"; } } else { warn "incorrect number of fields at line $.\n"; warn sprintf("expected: %d but found %d\n",scalar(@fields), scala +r(@player_rec)); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://460155]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.