Answers.Body: <p>This issue is been resolved in <a href="https://issues.civicrm.org/jira/browse/CRM-16858" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-16858</a> against coming 4.6.6. You can find the fix here <a href="https://github.com/civicrm/civicrm-core/pull/6238" rel="nofollow">https://github.com/civicrm/civicrm-core/pull/6238</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-30T22:15:31.923Z
Answers.Text: Thank you!  I searched and could not find this fix, appreciate you providing the link for the fix.  All good!
Answers.UserDisplayName: Friendswood Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-30T16:34:34.883Z
Answers.LastActivityDate: 2015-07-30T16:34:34.883Z
Answers.UserDisplayName: Monish Deb
Body: <p>I have a drupal 7 site running Civi 4.6.5 and using it for event registrations.  </p>
  
  <p>When attempting to view Participants from the Event page, I receive a <code>DB Error: syntax error</code>.   See backtrace below.  I am able to view a report of registered participants without an issue - just problems using the icon on the event page.  Any ideas?</p>
  
  <pre><code>#0 /sites/all/modules/civicrm/CRM/Core/Error.php(182): CRM_Core_Error::backtrace()
  #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
  #2 /sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #3 /sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error-&gt;PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #4 /sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error-&gt;DB_Error(-2, 16, (Array:2), "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #5 /sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR-&gt;raiseError(NULL, -2, NULL, NULL, "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...", "DB_Error", TRUE)
  #6 /sites/all/modules/civicrm/packages/DB/mysql.php(899): DB_common-&gt;raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
  #7 /sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql-&gt;mysqlRaiseError()
  #8 /sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql-&gt;simpleQuery("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #9 /sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common-&gt;query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #10 /sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject-&gt;_query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #11 /sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject-&gt;query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #12 /sites/all/modules/civicrm/CRM/Core/DAO.php(1221): CRM_Core_DAO-&gt;query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...", TRUE)
  #13 /sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(4609): CRM_Core_DAO::singleValueQuery("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #14 /sites/all/modules/civicrm/CRM/Event/Selector/Search.php(288): CRM_Contact_BAO_Query-&gt;searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, FALSE, NULL)
  #15 /sites/all/modules/civicrm/CRM/Core/Selector/Controller.php(233): CRM_Event_Selector_Search-&gt;getTotalCount(4, NULL)
  #16 /sites/all/modules/civicrm/CRM/Event/Form/Search.php(336): CRM_Core_Selector_Controller-&gt;__construct(Object(CRM_Event_Selector_Search), NULL, NULL, 4, Object(CRM_Event_Form_Search), 1, NULL)
  #17 /sites/all/modules/civicrm/CRM/Event/Form/Search.php(124): CRM_Event_Form_Search-&gt;postProcess()
  #18 /sites/all/modules/civicrm/CRM/Core/Form.php(455): CRM_Event_Form_Search-&gt;preProcess()
  #19 /sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(94): CRM_Core_Form-&gt;buildForm()
  #20 /sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display-&gt;perform(Object(CRM_Event_Form_Search), "display")
  #21 /sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller-&gt;handle(Object(CRM_Event_Form_Search), "display")
  #22 /sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page-&gt;handle("display")
  #23 /sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller-&gt;run((Array:3), NULL)
  #24 /sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14))
  #25 /sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
  #26 /sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
  #27 [internal function](): civicrm_invoke("event", "search")
  #28 /includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2))
  #29 /index.php(21): menu_execute_active_handler()
  #30 {main}
  </code></pre>
  
Tags: <civievent>
Title: Error Viewing Participants from Event Screen
ThreadText: # Error Viewing Participants from Event Screen
  
  (Asked by: username_0 on 2015-07-30)
  
  I have a drupal 7 site running Civi 4.6.5 and using it for event registrations.
  
  When attempting to view Participants from the Event page, I receive a `DB Error: syntax error`. See backtrace below. I am able to view a report of registered participants without an issue - just problems using the icon on the event page. Any ideas?
  
  ```
  #0 /sites/all/modules/civicrm/CRM/Core/Error.php(182): CRM_Core_Error::backtrace()
  #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
  #2 /sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #3 /sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #4 /sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #5 /sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -2, NULL, NULL, "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...", "DB_Error", TRUE)
  #6 /sites/all/modules/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
  #7 /sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
  #8 /sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #9 /sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #10 /sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #11 /sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #12 /sites/all/modules/civicrm/CRM/Core/DAO.php(1221): CRM_Core_DAO->query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...", TRUE)
  #13 /sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(4609): CRM_Core_DAO::singleValueQuery("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
  #14 /sites/all/modules/civicrm/CRM/Event/Selector/Search.php(288): CRM_Contact_BAO_Query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, FALSE, NULL)
  #15 /sites/all/modules/civicrm/CRM/Core/Selector/Controller.php(233): CRM_Event_Selector_Search->getTotalCount(4, NULL)
  #16 /sites/all/modules/civicrm/CRM/Event/Form/Search.php(336): CRM_Core_Selector_Controller->__construct(Object(CRM_Event_Selector_Search), NULL, NULL, 4, Object(CRM_Event_Form_Search), 1, NULL)
  #17 /sites/all/modules/civicrm/CRM/Event/Form/Search.php(124): CRM_Event_Form_Search->postProcess()
  #18 /sites/all/modules/civicrm/CRM/Core/Form.php(455): CRM_Event_Form_Search->preProcess()
  #19 /sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(94): CRM_Core_Form->buildForm()
  #20 /sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Event_Form_Search), "display")
  #21 /sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_Search), "display")
  #22 /sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("display")
  #23 /sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL)
  #24 /sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14))
  #25 /sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
  #26 /sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
  #27 [internal function](): civicrm_invoke("event", "search")
  #28 /includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2))
  #29 /index.php(21): menu_execute_active_handler()
  #30 {main}
  
  ```
  
  **Tags:** civievent
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-07-30. Score: 3 | Accepted answer
  
  This issue is been resolved in <https://issues.civicrm.org/jira/browse/CRM-16858> against coming 4.6.6. You can find the fix here <https://github.com/civicrm/civicrm-core/pull/6238>.
  
  > **Comments:**
  > **username_0**: Thank you!  I searched and could not find this fix, appreciate you providing the link for the fix.  All good!  
  
  ---
  
  