diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index e0ad4a0420b..4dabf1f6c91 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -103,14 +103,16 @@ if ($type == 'global') { $errmsg .= $project->error; $errors = array_merge($errors, $project->errors); } else { - $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."projet"; - $sql .= " WHERE ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee = ".((int) $project->id); + $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee"; + $sql .= " WHERE fk_project = ".((int) $project->id); - $resql = $db->query($resql); + $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); if ($obj) { $currentnbofattendees = $obj->nb; + } else { + dol_print_error($db); } } }