Fetching single row, single column with PDO

Are you sure it’s returning any rows?

$stmt->fetchColumn()

is correct way to fetch a single value, so either you probably didn’t bind the :user parameter or it simply returned no rows.

Leave a Comment