diff --git a/register_participants.inc.php b/register_participants.inc.php index 6120728..09ec7de 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -523,6 +523,9 @@ function getProject($userId){ return "register_participants.inc.php::getProject -> User not found"; } $regId = $result['registrations_id']; + if(!$regId) { + return "register_participants.inc.php::getProject -> no registration id"; + } // FIXME - in the future, this should be able to handle a many-to-many // relationship in projects to registrations (so remove that LIMIT 1) $fields = implode(',', array( @@ -544,8 +547,11 @@ function getProject($userId){ AND projects.conferences_id='".$conference['id']."' LIMIT 1"); if(mysql_error()) { - return "register_participants.inc.php::getProject -> " . $mysql_error(); - }else{ + return "register_participants.inc.php::getProject -> sql error: " . $mysql_error(); + } else if(mysql_num_rows($q)!=1) { + return "register_participants.inc.php::getProject -> no project"; + } + else { $returnval = mysql_fetch_assoc($q); }