Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by peppiv (Curate)
on Jun 14, 2002 at 17:45 UTC ( #174653=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

I've tried using

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

and this worked. I've even tried using placeholders for both LIMIT values.

peppiv


Comment on Re: Re: Trouble updating value of variable for a placeholder
Download Code
Replies are listed 'Best First'.
Re: Re: Re: Trouble updating value of variable for a placeholder
by peppiv (Curate) on Jun 14, 2002 at 18:43 UTC
    stajich Thanks for the help. I've tried printing $limit. It returns '0' when I first call the sub, which is what I want. LIMIT 0,10 returns rows 1-10. The second time I call it it returns 10, which is also what I want. LIMIT 10,10 returns rows 11-20. But for some reason it bugs out.

    Still getting the error:

    You have an error in your SQL syntax near ''10',10' at line 1 at /usr/local/etc/httpd/cgi-bin/return.pl line 590.

    Which is where LIMIT is used.

    Aarrggggh!

    peppiv

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2015-07-31 02:23 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 (274 votes), past polls