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 CiviContribute (Moderator: Donald Lobo) »
  • DB Error: syntax error - Civicontribute
Pages: [1]

Author Topic: DB Error: syntax error - Civicontribute  (Read 822 times)

sayf00

  • Guest
DB Error: syntax error - Civicontribute
April 06, 2009, 05:14:44 pm
Hi,

I've civicrm installed on Joomla, everything seems to be working fine accept for the contributions page.

I have a membership page setup, but when a user completes the signup they are presented with the following:

Code: [Select]
Sorry. A non-recoverable error has occurred.

DB Error: syntax error

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 'AND civicrm_contribution.is_test = '0' ) AND ( 1 ) GROUP BY contact_a.id' at line 7, 1064

Error Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT DISTINCT(contact_a.id) as contact_id, contact_a.first_name  as `first_name`, contact_a.last_name  as `last_name`, contact_a.birth_date  as `birth_date`, `Home-location_type`.id as `Home-location_type_id`, `Home-location_type`.name as `Home-location_type`, `Home-address`.id as `Home-address_id`, `Home-address`.name as `Home-address_name`, `1-location_type`.id as `1-location_type_id`, `1-location_type`.name as `1-location_type`, `1-address`.id as `1-address_id`, `1-address`.city as `1-city`, `1-address`.postal_code as `1-postal_code`, `1-country`.id as `1-country_id`, `1-country`.name as `1-country`, civicrm_value_membership_1.id as civicrm_value_membership_1_id, civicrm_value_membership_1.current_last_educational_institu_7 as custom_7, civicrm_value_membership_1.eductional_status_8 as custom_8, civicrm_value_membership_1.telephone_number_22 as custom_22, civicrm_value_membership_1.mobile_number_23 as custom_23  FROM civicrm_contact contact_a
LEFT JOIN civicrm_address `1-address` ON (`1-address`.contact_id = contact_a.id AND `1-address`.is_primary = 1) 
LEFT JOIN civicrm_address `Home-address` ON (`Home-address`.contact_id = contact_a.id AND `Home-address`.location_type_id = 1) 
LEFT JOIN civicrm_country `1-country` ON `1-country`.id = `1-address`.country_id 
LEFT JOIN civicrm_location_type `1-location_type` ON (  ( `1-address`.location_type_id = `1-location_type`.id )  ) 
LEFT JOIN civicrm_location_type `Home-location_type` ON (  ( `Home-address`.location_type_id = `Home-location_type`.id )  )  LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id 
LEFT JOIN civicrm_value_membership_1 ON civicrm_value_membership_1.entity_id = civicrm_contribution.id  WHERE  ( contact_a.id = 22 AND  civicrm_contribution.id =  AND  civicrm_contribution.is_test = '0' )  AND  ( 1 )   GROUP BY contact_a.id   [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 'AND  civicrm_contribution.is_test = '0' )  AND  ( 1 )   GROUP BY contact_a.id' at line 7]
    [type] => DB_Error
    [user_info] => SELECT DISTINCT(contact_a.id) as contact_id, contact_a.first_name  as `first_name`, contact_a.last_name  as `last_name`, contact_a.birth_date  as `birth_date`, `Home-location_type`.id as `Home-location_type_id`, `Home-location_type`.name as `Home-location_type`, `Home-address`.id as `Home-address_id`, `Home-address`.name as `Home-address_name`, `1-location_type`.id as `1-location_type_id`, `1-location_type`.name as `1-location_type`, `1-address`.id as `1-address_id`, `1-address`.city as `1-city`, `1-address`.postal_code as `1-postal_code`, `1-country`.id as `1-country_id`, `1-country`.name as `1-country`, civicrm_value_membership_1.id as civicrm_value_membership_1_id, civicrm_value_membership_1.current_last_educational_institu_7 as custom_7, civicrm_value_membership_1.eductional_status_8 as custom_8, civicrm_value_membership_1.telephone_number_22 as custom_22, civicrm_value_membership_1.mobile_number_23 as custom_23  FROM civicrm_contact contact_a
LEFT JOIN civicrm_address `1-address` ON (`1-address`.contact_id = contact_a.id AND `1-address`.is_primary = 1) 
LEFT JOIN civicrm_address `Home-address` ON (`Home-address`.contact_id = contact_a.id AND `Home-address`.location_type_id = 1) 
LEFT JOIN civicrm_country `1-country` ON `1-country`.id = `1-address`.country_id 
LEFT JOIN civicrm_location_type `1-location_type` ON (  ( `1-address`.location_type_id = `1-location_type`.id )  ) 
LEFT JOIN civicrm_location_type `Home-location_type` ON (  ( `Home-address`.location_type_id = `Home-location_type`.id )  )  LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id 
LEFT JOIN civicrm_value_membership_1 ON civicrm_value_membership_1.entity_id = civicrm_contribution.id  WHERE  ( contact_a.id = 22 AND  civicrm_contribution.id =  AND  civicrm_contribution.is_test = '0' )  AND  ( 1 )   GROUP BY contact_a.id   [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 'AND  civicrm_contribution.is_test = '0' )  AND  ( 1 )   GROUP BY contact_a.id' at line 7]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT DISTINCT(contact_a.id) as contact_id, contact_a.first_name  as `first_name`, contact_a.last_name  as `last_name`, contact_a.birth_date  as `birth_date`, `Home-location_type`.id as `Home-location_type_id`, `Home-location_type`.name as `Home-location_type`, `Home-address`.id as `Home-address_id`, `Home-address`.name as `Home-address_name`, `1-location_type`.id as `1-location_type_id`, `1-location_type`.name as `1-location_type`, `1-address`.id as `1-address_id`, `1-address`.city as `1-city`, `1-address`.postal_code as `1-postal_code`, `1-country`.id as `1-country_id`, `1-country`.name as `1-country`, civicrm_value_membership_1.id as civicrm_value_membership_1_id, civicrm_value_membership_1.current_last_educational_institu_7 as custom_7, civicrm_value_membership_1.eductional_status_8 as custom_8, civicrm_value_membership_1.telephone_number_22 as custom_22, civicrm_value_membership_1.mobile_number_23 as custom_23  FROM civicrm_contact contact_a
LEFT JOIN civicrm_address `1-address` ON (`1-address`.contact_id = contact_a.id AND `1-address`.is_primary = 1) 
LEFT JOIN civicrm_address `Home-address` ON (`Home-address`.contact_id = contact_a.id AND `Home-address`.location_type_id = 1) 
LEFT JOIN civicrm_country `1-country` ON `1-country`.id = `1-address`.country_id 
LEFT JOIN civicrm_location_type `1-location_type` ON (  ( `1-address`.location_type_id = `1-location_type`.id )  ) 
LEFT JOIN civicrm_location_type `Home-location_type` ON (  ( `Home-address`.location_type_id = `Home-location_type`.id )  )  LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id 
LEFT JOIN civicrm_value_membership_1 ON civicrm_value_membership_1.entity_id = civicrm_contribution.id  WHERE  ( contact_a.id = 22 AND  civicrm_contribution.id =  AND  civicrm_contribution.is_test = '0' )  AND  ( 1 )   GROUP BY contact_a.id   [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 'AND  civicrm_contribution.is_test = '0' )  AND  ( 1 )   GROUP BY contact_a.id' at line 7]"]
)


The user is still created and an email sent out, it just throws up the message which is confusing for the user.

Any help would be greatly appreciated.

You can test the error by signing up for a free account at: http://aspire4law.co.uk/index.php?option=com_civicrm&view=Contributions&Itemid=109 feel free to use fake info.

Many Thanks
Sayf[/code]

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: DB Error: syntax error - Civicontribute
April 06, 2009, 06:19:39 pm

r u using 2.2beta2?

if so, can u please upgrade to 2.2.2

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • DB Error: syntax error - Civicontribute

This forum was archived on 2017-11-26.