I have a simple query here, basically I want to check the rows for a combination of parameters to have each person logged on a project only once. I want to check for the id/info combo and return either the id or a 0 for new entry. The query here returns nil, but I'd like to return 0 if no results found. I can check all rows using case or IF statements, but I just can't get the query right to select based on the results from all rows. Thanks!
SELECT id FROM project_team WHERE name = ? AND project_id = ?