Selecting all ids(rows) except one id(row) in sql using php

Sample Query, here we select all page ids and its count but id except a particular number, Query inside braces of NOT IN condition:

“SELECT `page_id`, COUNT(`page_id`) AS `total` FROM `table.comments` WHERE `page_id` NOT IN (
SELECT `id` FROM pages WHERE `identifier` = ‘$except_id’) GROUP BY `page_id`”