This:
$success = $output->execute();
only returns true or false, indicating the query execution was successful or not - it does not return the amount of records returned.
See:
http://php.net/manual/en/pdostatement.execute.php[
^]
To get the amount of records returned, use rowCount():
http://php.net/manual/en/pdostatement.rowcount.php[
^]
But if you are only interested in the amount of records that fit your query-predicate (and not in the records themselves), you shouldn't
SELECT * but
SELECT Count(*) , then fetch the query result like you already do in other parts of your code, with fetch() or fetchAll() and then read from the returned array:
http://php.net/manual/en/pdostatement.fetchall.php[
^]
Edit: formatting