Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Trouble updating value of variable for a placeholder

by peppiv (Curate)
on Jun 18, 2002 at 12:48 UTC ( #175350=note: print w/replies, xml ) Need Help??


in reply to Re: Trouble updating value of variable for a placeholder
in thread Trouble updating value of variable for a placeholder

UPDATE

Workaround Solution

I found a bug report on the web and a workaround solution. Thought some people might want to know this.

my $sth = $dbh->prepare('SELECT * FROM applicant WHERE date_col = ? OR +DER BY job_position LIMIT ?,10'); $sth->bind_param(2, $limit, DBI::SQL_INTEGER); $sth->execute($date,$limit) or die $sth->errstr;

Sometimes when using placeholders, especially for LIMIT, the DBD gets a little confused on what type of value it's being given. Line 2 binds the string $limit to an integer value. The "2" in the parenthesis is telling it the second string in the 'execute'. If you needed it for the first string it would be sth->bind_param(1, $date, DBI::SQL_INTEGER);
Hey it worked for me. Maybe it can help someone else out.

peppiv

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://175350]
help
Chatterbox?
[ww]: (but pls don't s/senior/senile/ ... not yet
[karlgoethebier]: A bit more audience now: The Impact of Information Sources on Code Security Very interesting IMHO...
[karlgoethebier]: ..it's about copy & paste ;-)
[ww]: Wonder what IEEE would have thought w/survey based on PM/perl
[ww]: s/thought/found/
[erix]: that title is a broken* sentence, no? But maybe that's deliberate
[karlgoethebier]: ww:My first thought, to be honest...
[erix]: and those authors' names don't look like native english speakers. Then again, neither am I :)
[karlgoethebier]: but the set of test persons is very small, like in medical studies: "We analyzed 50..."

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2017-09-25 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (280 votes). Check out past polls.

    Notices?