I am trying to get a top info using an "where in" clause but if i use bindvalue or bindparam i don't get any results.
Here is my the query that doesn't give any results
$user2 = $db->prepare("Select top 100 memb_guid,memb___id,mail_addr,Gender,Country from MEMB_INFO where memb___id in (Select memb___id from MEMB_STAT where IP = :ip)");
$user2->bindValue(':ip','127.0.0.1',PDO::PARAM_STR);
$user2->execute();
If I use direct search without any bindvalues or param I get the results
$user2 = $db->prepare("Select top 100 memb_guid,memb___id,mail_addr,Gender,Country from MEMB_INFO where memb___id in (Select memb___id from MEMB_STAT where IP = '127.0.0.1')");
$user2->execute();
Can anyone help me out to use the bindvalue or param on this search 'where in' clause?
@PhilCross This is what I get when use var_dump:
object(PDOStatement)#4 (1) { ["queryString"]=> string(142) "Select top 100 memb_guid,memb___id,mail_addr,Gender,Country from MEMB_INFO where memb___id in (Select memb___id from MEMB_STAT where IP = :ip)"
Ps: I am using MSSQL Server