CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • SQL Syntax Error when trying to view any events
Pages: [1]

Author Topic: SQL Syntax Error when trying to view any events  (Read 16856 times)

innovafire

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.22
  • MySQL version: 5.1
  • PHP version: 5
SQL Syntax Error when trying to view any events
May 11, 2013, 09:52:44 am
I have a site that is Drupal 7 and Civi 4.2.  Everything seems to be working fine except for part of the events features.

I can actually CREATE events fine (and edit them after created), and when I go to manage events, they are listed there.  But if I click either the event name from that screen or if I pick EVENT LINKS >> REGISTRATION (Test Drive) or REGISTRATION (Live) I get a SQL error.

Following is the error I get when I click on the event name:

Code: [Select]
backTrace
#0 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/packages/DB.php(968): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "\n    SELECT  participant.id id,\n            event.event_full_text as event_...")
#4 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "\n    SELECT  participant.id id,\n            event.event_full_text as event_...")
#5 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/packages/DB/common.php(1903): PEAR->raiseError(NULL, -2, NULL, NULL, "\n    SELECT  participant.id id,\n            event.event_full_text as event_...", "DB_Error", TRUE)
#6 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
#7 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
#8 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("\n    SELECT  participant.id id,\n            event.event_full_text as event_...")
#9 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/packages/DB/DataObject.php(2421): DB_common->query("\n    SELECT  participant.id id,\n            event.event_full_text as event_...")
#10 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query("\n    SELECT  participant.id id,\n            event.event_full_text as event_...")
#11 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/CRM/Core/DAO.php(155): DB_DataObject->query("\n    SELECT  participant.id id,\n            event.event_full_text as event_...")
#12 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/CRM/Core/DAO.php(922): CRM_Core_DAO->query("\n    SELECT  participant.id id,\n            event.event_full_text as event_...", TRUE)
#13 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/CRM/Event/BAO/Participant.php(424): CRM_Core_DAO::executeQuery("\n    SELECT  participant.id id,\n            event.event_full_text as event_...", (Array:1))
#14 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/CRM/Event/Page/EventInfo.php(239): CRM_Event_BAO_Participant::eventFull("7", FALSE, "0")
#15 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/CRM/Core/Invoke.php(220): CRM_Event_Page_EventInfo->run((Array:3), NULL)
#16 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/CRM/Core/Invoke.php(51): CRM_Core_Invoke::_invoke((Array:3))
#17 /home/busine10/public_html/bigpennsauken.com/sites/all/modules/civicrm/drupal/civicrm.module(500): CRM_Core_Invoke::invoke((Array:3))
#18 [internal function](): civicrm_invoke("event", "info")
#19 /home/busine10/public_html/bigpennsauken.com/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2))
#20 /home/busine10/public_html/bigpennsauken.com/index.php(22): menu_execute_active_handler()
#21 {main}
Sorry but we are not able to provide this at the moment.
________________________________________
DB Error: syntax error
Error Details
Database Error Code: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 6, 1064
Additional Details:
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
    SELECT  participant.id id,
            event.event_full_text as event_full_text,
            event.max_participants as max_participants
      FROM  civicrm_participant participant
INNER JOIN  civicrm_event event ON ( event.id = participant.event_id )
             WHERE  event.id = 7  AND  ( participant.is_test = 0 OR participant.is_test IS NULL )  AND  participant.role_id IN ( 1, 2, 3, 4, 5, 6 )  AND  participant.status_id IN (  )  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 6]
    [type] => DB_Error
    [user_info] =>
    SELECT  participant.id id,
            event.event_full_text as event_full_text,
            event.max_participants as max_participants
      FROM  civicrm_participant participant
INNER JOIN  civicrm_event event ON ( event.id = participant.event_id )
             WHERE  event.id = 7  AND  ( participant.is_test = 0 OR participant.is_test IS NULL )  AND  participant.role_id IN ( 1, 2, 3, 4, 5, 6 )  AND  participant.status_id IN (  )  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 6]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
    SELECT  participant.id id,
            event.event_full_text as event_full_text,
            event.max_participants as max_participants
      FROM  civicrm_participant participant
INNER JOIN  civicrm_event event ON ( event.id = participant.event_id )
             WHERE  event.id = 7  AND  ( participant.is_test = 0 OR participant.is_test IS NULL )  AND  participant.role_id IN ( 1, 2, 3, 4, 5, 6 )  AND  participant.status_id IN (  )  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 6]"]



Any assistance would be appreciated.

Chris

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: SQL Syntax Error when trying to view any events
May 12, 2013, 04:19:28 am
The bad SQL is participant.status_id IN (  ) . Did you delete any participants status options, or edit that option list?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

innovafire

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.22
  • MySQL version: 5.1
  • PHP version: 5
Re: SQL Syntax Error when trying to view any events
May 12, 2013, 05:35:08 am
Thanks for your insight.  I'm not aware of having made changes to "participant status".  I'm not even exactly sure what that is or what options that would include (this is a new site and I have not used Civi before this project).

Just now I went to the "Find Participants feature" and there is nothing to select in the dropdown for participant status.  So it does seem that whatever options should be there are not there.

Where or how would I go about entering in some statuses to resolve this?

Chris

innovafire

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.22
  • MySQL version: 5.1
  • PHP version: 5
Re: SQL Syntax Error when trying to view any events
May 12, 2013, 07:29:04 am
Nevermind, I found it under ADMINISTRATION >> CIVIEVENTS and once i added some participant statuses, the events started working.

THANK YOU!!!

Chris

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: SQL Syntax Error when trying to view any events
May 12, 2013, 08:41:37 am
My pleasure. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • SQL Syntax Error when trying to view any events

This forum was archived on 2017-11-26.