0

I'm trying to return the members who's ID's aren't on the list provided in the MySql statement.

Heres the members table:

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

Here is my query statement:

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

$mTotal should be returning 0 but instead is returning 3. Can anyone explain why?

SReca
  • 643
  • 3
  • 13
  • 37

0 Answers0