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 CiviMember (Moderator: Deepak Srivastava) »
  • SQL Error / No Membership Generated from Contribution
Pages: [1]

Author Topic: SQL Error / No Membership Generated from Contribution  (Read 765 times)

jobewan

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 0
SQL Error / No Membership Generated from Contribution
January 14, 2011, 01:51:15 pm
Hello All:

Couple of days ago, I used MySQL Admin to expire about three dozen membership records.  I did this in the "membership" table by changing the Status ID from "something" to "-4" (from the second set of numbers that came up when I browsed the field(s).

Since then, I have been getting this error and related detail when a new membership contribution is accepted.  The contribution records just fine, but does not generate a membership  ANY insight toward rectification would be gratefully received:

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_membership.contact_id = 5984 ) AND ( civicrm_membership.membe' at line 4, 1064

Error Details:

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

       
Code: [Select]
=> -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.contact_id = 5984 ) AND (  civicrm_membership.membership_type_id = 4 )
 
 
 ORDER BY start_date DESC 
 [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_membership.contact_id = 5984 ) AND (  civicrm_membership.membe' at line 4]
    [type] => DB_Error
    [user_info] => SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.contact_id = 5984 ) AND (  civicrm_membership.membership_type_id = 4 )
 
 ORDER BY start_date DESC 
 [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_membership.contact_id = 5984 ) AND (  civicrm_membership.membe' at line 4]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT *
 FROM civicrm_membership
 
 WHERE ( status_id !=  )  AND (  civicrm_membership.contact_id = 5984 ) AND (  civicrm_membership.membership_type_id = 4 )
 ORDER BY start_date DESC 
 [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_membership.contact_id = 5984 ) AND (  civicrm_membership.membe' at line 4]"]
)

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: SQL Error / No Membership Generated from Contribution
January 14, 2011, 02:06:07 pm

i'm surprised mysql let u set status_id to -4 (since thats an invalid FK to the membership_status table)

In the default clean install, the Expired status_id = 4

u might wnat to change that in your db and see if it works

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

jobewan

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 0
Re: SQL Error / No Membership Generated from Contribution
January 15, 2011, 02:57:23 am
Excuse me for not being more clear:

- When I bring up a membership record in MySQL Admin the status_id field for any already expired record (expired by way of the CiviCRM interface or by the system automatically) contains a value of "4 -".

- When I open the pulldown for the status_id field, the available selections are:

  - 5
  - 6
  - 4
  - 3
  - 2
  - 1

  1 -
  2 -
  3 -
  4 -
  5 -
  6 -

I chose "4 -" for each record I manually expired in MySQL.  In other words, I looked at an existing expired record, and duplicated the selection in the status_id field across a number of other records.

It is difficult for me to understand how this action could cause a shortcoming of such magnitude (SQL error) even when generating new memberships from scratch.

jobewan

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 0
Re: SQL Error / No Membership Generated from Contribution
January 15, 2011, 03:05:00 am
Is it possible that that is_override variable must be set to "1", indicating an administrative/manual override?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • SQL Error / No Membership Generated from Contribution

This forum was archived on 2017-11-26.