MySQL PDO" NOT IN"声明返回错误计数

时间:2015-08-01 14:19:12

标签: php mysql list pdo notin

我试图回复那些ID不在MySql语句中提供的列表上的成员。

会员表:

--------------------
| ID | Member Name |
--------------------
|  1 | John Smith  |
--------------------
|  2 | Larry Brown |
--------------------
|  3 | Jim Gray    |
--------------------

以下是我的查询声明:

$entries[':list'] = "1,2,3";
$mQuery = $this->db->prepare("SELECT * FROM members WHERE ID NOT IN (:list)");
$mQuery->execute($entries);
$mTotal = $mQuery->rowCount();

$ mTotal应返回0,而是返回3.有人可以解释原因吗?

0 个答案:

没有答案