API - Basic API calls

$check here returns one row. Which is an empty array or a full array. I think you can optimize your query by doing SELECT COUNT(*) and then checking $row[0] if it is bigger than 0. Select count should be better that the regular select where you store member_id