Welcome Guest, Not a member yet? Register   Sign In
query with "IN" parameter
#4

(This post was last modified: 05-25-2019, 08:57 AM by dave friend.)

Don't put the first placeholder in parentheses.

What I mean is, instead of

PHP Code:
$sql  'SELECT x,y,z from TABLE WHERE x IN (?) and y=?'

try this

PHP Code:
$x =array('a','b','c');
$y =3;
$sql  'SELECT x,y,z from TABLE WHERE x IN ? and y=?';
$result $this->db->query($sql, array($x$y)); 
Reply


Messages In This Thread
query with "IN" parameter - by utodev - 05-23-2019, 03:16 AM
RE: query with "IN" parameter - by php_rocs - 05-23-2019, 06:55 AM
RE: query with "IN" parameter - by utodev - 05-25-2019, 06:30 AM
RE: query with "IN" parameter - by dave friend - 05-25-2019, 08:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB