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) »
  • Database Error - Please Help
Pages: [1]

Author Topic: Database Error - Please Help  (Read 1225 times)

tbarhorst

  • Guest
Database Error - Please Help
June 10, 2008, 09:58:08 am
When trying to add a member in our organization, we now get the following errors:  How do we fix this?
It was working.

This is Civi 2.0.2 with Drupal 5

------------------------------------------
Sorry. A non-recoverable error has occurred.

Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`userweb11146a/civicrm_membership`, CONSTRAINT `FK_civicrm_membership_status_id` FOREIGN KEY (`status_id`) REFERENCES `civicrm_membership_status` (`id`) ON DELETE CASCADE), 1452



Error Details:

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

       
Code: [Select]
=> -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_membership (contact_id , membership_type_id , source , status_id , is_override ) VALUES ( 145 ,  4 , 'Online Contribution: Join the Oceanic Society' ,  5 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`userweb11146a/civicrm_membership`, CONSTRAINT `FK_civicrm_membership_status_id` FOREIGN KEY (`status_id`) REFERENCES `civicrm_membership_status` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_membership (contact_id , membership_type_id , source , status_id , is_override ) VALUES ( 145 ,  4 , 'Online Contribution: Join the Oceanic Society' ,  5 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`userweb11146a/civicrm_membership`, CONSTRAINT `FK_civicrm_membership_status_id` FOREIGN KEY (`status_id`) REFERENCES `civicrm_membership_status` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_membership (contact_id , membership_type_id , source , status_id , is_override ) VALUES ( 145 ,  4 , 'Online Contribution: Join the Oceanic Society' ,  5 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`userweb11146a/civicrm_membership`, CONSTRAINT `FK_civicrm_membership_status_id` FOREIGN KEY (`status_id`) REFERENCES `civicrm_membership_status` (`id`) ON DELETE CASCADE)]"]
)


Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Database Error - Please Help
June 25, 2008, 07:09:48 am
Check this - http://forum.civicrm.org/index.php/topic,2838.0.html . Solution is exactly the same.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Database Error - Please Help

This forum was archived on 2017-11-26.