djlerman has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to create a prepared statement with perl using MySQL's IN ().
It looks something like this:
This doesn't seem to work. :-( What is the useful wisdom around this?$valuesForIn = "1,2,3,4,5"; $query = " SELECT field1 FROM table1 WHERE field2 IN (?) "; $sth1 = $dbh->prepare($query) or die->$errstr(); $sth1->execute($valuesForIn) or die $dbh->errstr;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: SQL prepared statements using MySQL In ()
by talexb (Chancellor) on Aug 10, 2023 at 17:56 UTC | |
Re: SQL prepared statements using MySQL In ()
by LanX (Saint) on Aug 10, 2023 at 17:54 UTC | |
Re: SQL prepared statements using MySQL In ()
by kcott (Archbishop) on Aug 11, 2023 at 12:47 UTC | |
by djlerman (Sexton) on Aug 11, 2023 at 16:53 UTC | |
Re: SQL prepared statements using MySQL In ()
by Marshall (Canon) on Aug 10, 2023 at 18:39 UTC | |
Re: SQL prepared statements using MySQL In ()
by Anonymous Monk on Aug 10, 2023 at 23:30 UTC |
Back to
Seekers of Perl Wisdom