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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • DB Error: Syntax Error after upgrade from 4.4.6 to 4.5.4
Pages: [1]

Author Topic: DB Error: Syntax Error after upgrade from 4.4.6 to 4.5.4  (Read 333 times)

manfredwoodall

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
  • CiviCRM version: 4.5.4
  • CMS version: Wordpress 4.0.1
  • MySQL version: 5.5.xx
  • PHP version: 5.3.18
DB Error: Syntax Error after upgrade from 4.4.6 to 4.5.4
December 16, 2014, 01:07:24 pm
Hey there we recently upgraded a client site from 4.4.6 to 4.5.4 and WP 4.0.1 We're having the following errors when someone tries to access forms on the front end of the site when they are logged in:

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 ') WHERE ( contact_a.id = '21527' ) GROUP BY contact_a.id LIMIT 0, 25' at line 9, 1064
Additional Details:
Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT contact_a.id as contact_id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.first_name  as `first_name`, contact_a.middle_name  as `middle_name`, contact_a.last_name  as `last_name`, contact_a.job_title  as `job_title`, contact_a.household_name  as `household_name`, IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name, IF ( contact_a.contact_type = 'Individual', contact_a.organization_name, NULL ) as current_employer, `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`.street_address as `1-street_address`, `1-address`.supplemental_address_2 as `1-supplemental_address_2`, `1-address`.city as `1-city`, `1-address`.state_province_id as `1-state_province_id`, `1-address`.postal_code as `1-postal_code`, `Work-location_type`.id as `Work-location_type_id`, `Work-location_type`.name as `Work-location_type`, `Work-phone-1`.id as `Work-phone-1_id`, `Work-phone-1`.phone as `Work-phone-1`, `Work-phone-1`.phone_ext as `Work-phone_ext-1`, `Other-location_type`.id as `Other-location_type_id`, `Other-location_type`.name as `Other-location_type`, `Other-phone-2`.id as `Other-phone-2_id`, `Other-phone-2`.phone as `Other-phone-2`, `website--url`.id as `website--url_id`, `website--url`.url as `website--url`, `website--url`.website_type_id as `website--website_type_id`, civicrm_value_contact_type_14.id as civicrm_value_contact_type_14_id, civicrm_value_contact_type_14.contact_type_114 as custom_114  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_phone `Other-phone-2` ON contact_a.id = `Other-phone-2`.contact_id AND `Other-phone-2`.location_type_id = 4 AND ( `Other-phone-2`.phone_type_id = '2' OR `Other-phone-2`.phone_type_id IS NULL )   
LEFT JOIN civicrm_phone `Work-phone-1` ON contact_a.id = `Work-phone-1`.contact_id AND `Work-phone-1`.location_type_id = 2 AND ( `Work-phone-1`.phone_type_id = '1' OR `Work-phone-1`.phone_type_id IS NULL )   
LEFT JOIN civicrm_location_type `1-location_type` ON (  ( `1-address`.location_type_id = `1-location_type`.id )  ) 
LEFT JOIN civicrm_location_type `Other-location_type` ON (  ( `Other-phone-2`.location_type_id = `Other-location_type`.id ) ) 
LEFT JOIN civicrm_location_type `Work-location_type` ON (  ( `Work-phone-1`.location_type_id = `Work-location_type`.id ) ) 
LEFT JOIN civicrm_value_contact_type_14 ON civicrm_value_contact_type_14.entity_id = `contact_a`.id 
LEFT JOIN civicrm_website `website--url` ON (`website--url`.contact_id = contact_a.id AND `website--url`.website_type_id =  )  WHERE  ( contact_a.id = '21527' )   GROUP BY contact_a.id LIMIT 0, 25  [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 ')  WHERE  ( contact_a.id = '21527' )   GROUP BY contact_a.id LIMIT 0, 25' at line 9]
    [type] => DB_Error
    [user_info] => SELECT contact_a.id as contact_id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.first_name  as `first_name`, contact_a.middle_name  as `middle_name`, contact_a.last_name  as `last_name`, contact_a.job_title  as `job_title`, contact_a.household_name  as `household_name`, IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name, IF ( contact_a.contact_type = 'Individual', contact_a.organization_name, NULL ) as current_employer, `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`.street_address as `1-street_address`, `1-address`.supplemental_address_2 as `1-supplemental_address_2`, `1-address`.city as `1-city`, `1-address`.state_province_id as `1-state_province_id`, `1-address`.postal_code as `1-postal_code`, `Work-location_type`.id as `Work-location_type_id`, `Work-location_type`.name as `Work-location_type`, `Work-phone-1`.id as `Work-phone-1_id`, `Work-phone-1`.phone as `Work-phone-1`, `Work-phone-1`.phone_ext as `Work-phone_ext-1`, `Other-location_type`.id as `Other-location_type_id`, `Other-location_type`.name as `Other-location_type`, `Other-phone-2`.id as `Other-phone-2_id`, `Other-phone-2`.phone as `Other-phone-2`, `website--url`.id as `website--url_id`, `website--url`.url as `website--url`, `website--url`.website_type_id as `website--website_type_id`, civicrm_value_contact_type_14.id as civicrm_value_contact_type_14_id, civicrm_value_contact_type_14.contact_type_114 as custom_114  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_phone `Other-phone-2` ON contact_a.id = `Other-phone-2`.contact_id AND `Other-phone-2`.location_type_id = 4 AND ( `Other-phone-2`.phone_type_id = '2' OR `Other-phone-2`.phone_type_id IS NULL )   
LEFT JOIN civicrm_phone `Work-phone-1` ON contact_a.id = `Work-phone-1`.contact_id AND `Work-phone-1`.location_type_id = 2 AND ( `Work-phone-1`.phone_type_id = '1' OR `Work-phone-1`.phone_type_id IS NULL )   
LEFT JOIN civicrm_location_type `1-location_type` ON (  ( `1-address`.location_type_id = `1-location_type`.id )  ) 
LEFT JOIN civicrm_location_type `Other-location_type` ON (  ( `Other-phone-2`.location_type_id = `Other-location_type`.id ) ) 
LEFT JOIN civicrm_location_type `Work-location_type` ON (  ( `Work-phone-1`.location_type_id = `Work-location_type`.id ) ) 
LEFT JOIN civicrm_value_contact_type_14 ON civicrm_value_contact_type_14.entity_id = `contact_a`.id 
LEFT JOIN civicrm_website `website--url` ON (`website--url`.contact_id = contact_a.id AND `website--url`.website_type_id =  )  WHERE  ( contact_a.id = '21527' )   GROUP BY contact_a.id LIMIT 0, 25  [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 ')  WHERE  ( contact_a.id = '21527' )   GROUP BY contact_a.id LIMIT 0, 25' at line 9]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT contact_a.id as contact_id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.first_name  as `first_name`, contact_a.middle_name  as `middle_name`, contact_a.last_name  as `last_name`, contact_a.job_title  as `job_title`, contact_a.household_name  as `household_name`, IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name, IF ( contact_a.contact_type = 'Individual', contact_a.organization_name, NULL ) as current_employer, `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`.street_address as `1-street_address`, `1-address`.supplemental_address_2 as `1-supplemental_address_2`, `1-address`.city as `1-city`, `1-address`.state_province_id as `1-state_province_id`, `1-address`.postal_code as `1-postal_code`, `Work-location_type`.id as `Work-location_type_id`, `Work-location_type`.name as `Work-location_type`, `Work-phone-1`.id as `Work-phone-1_id`, `Work-phone-1`.phone as `Work-phone-1`, `Work-phone-1`.phone_ext as `Work-phone_ext-1`, `Other-location_type`.id as `Other-location_type_id`, `Other-location_type`.name as `Other-location_type`, `Other-phone-2`.id as `Other-phone-2_id`, `Other-phone-2`.phone as `Other-phone-2`, `website--url`.id as `website--url_id`, `website--url`.url as `website--url`, `website--url`.website_type_id as `website--website_type_id`, civicrm_value_contact_type_14.id as civicrm_value_contact_type_14_id, civicrm_value_contact_type_14.contact_type_114 as custom_114  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_phone `Other-phone-2` ON contact_a.id = `Other-phone-2`.contact_id AND `Other-phone-2`.location_type_id = 4 AND ( `Other-phone-2`.phone_type_id = '2' OR `Other-phone-2`.phone_type_id IS NULL )   
LEFT JOIN civicrm_phone `Work-phone-1` ON contact_a.id = `Work-phone-1`.contact_id AND `Work-phone-1`.location_type_id = 2 AND ( `Work-phone-1`.phone_type_id = '1' OR `Work-phone-1`.phone_type_id IS NULL )   
LEFT JOIN civicrm_location_type `1-location_type` ON (  ( `1-address`.location_type_id = `1-location_type`.id )  ) 
LEFT JOIN civicrm_location_type `Other-location_type` ON (  ( `Other-phone-2`.location_type_id = `Other-location_type`.id ) ) 
LEFT JOIN civicrm_location_type `Work-location_type` ON (  ( `Work-phone-1`.location_type_id = `Work-location_type`.id ) ) 
LEFT JOIN civicrm_value_contact_type_14 ON civicrm_value_contact_type_14.entity_id = `contact_a`.id 
LEFT JOIN civicrm_website `website--url` ON (`website--url`.contact_id = contact_a.id AND `website--url`.website_type_id =  )  WHERE  ( contact_a.id = '21527' )   GROUP BY contact_a.id LIMIT 0, 25  [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 ')  WHERE  ( contact_a.id = '21527' )   GROUP BY contact_a.id LIMIT 0, 25' at line 9]"]
)

 

I've looked around for this and I haven't found a solution.  Has anyone here seen this and is there a patch for it. It' pretty annoying because people are having issues registering for the site and renewing their memberships.

What's odd is it doesn't seem to affect all profiles.

Any help would be appreciated it.
« Last Edit: December 16, 2014, 01:20:13 pm by manfredwoodall »

manfredwoodall

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
  • CiviCRM version: 4.5.4
  • CMS version: Wordpress 4.0.1
  • MySQL version: 5.5.xx
  • PHP version: 5.3.18
Re: DB Error: Syntax Error after upgrade from 4.4.6 to 4.5.4
December 17, 2014, 08:16:46 am
So I basically rebuilt the profile on the form in question and it worked, not throwing the error - I don't know if this helps, but at least its a fix.

Any insight from he community would be greatly appreciated.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • DB Error: Syntax Error after upgrade from 4.4.6 to 4.5.4

This forum was archived on 2017-11-26.