Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-581

You have an error in your SQL syntax

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Labels:
      None

      Description

      I have installed Drupal and CivCRM on my MacOS X 10.2.8 Server running as follows:

      Server OS: Darwin 6.8
      Database: MySQL 4.0.26-standard
      PHP Version: 4.3.10 (Zend: 1.3.0)
      [i.e. Zend Optimizer v2.5.10]

      I used the mySQL query called civicrm_40.mysql to set up the tables, which all goes well.

      When I import the civicrm_generated.mysql query to import data, a numer of lines in the results report say something about Error: Cannot add or update a child... and then when I use the web site and go to CiviCRM, I get this error:

      Sorry. A non-recoverable error has occurred.
      Database Error Code: Cannot add or update a child row: a foreign key constraint fails, 1216

      Before importing that civicrm_generated.mysql, if i went to CiviCRM, I'd get this error instead:

      Find Contacts

      Sorry. A non-recoverable error has occurred.
      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 ') ORDER BY name' at line 1, 1064

      Return to CiviCRM menu.

      error

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

      [code] => -2
      [message] => DB Error: syntax error
      [mode] => 16
      [debug_info] => SELECT id, name FROM civicrm_state_province WHERE country_id IN () ORDER BY name [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 ') ORDER BY name' at line 1]
      [type] => db_error
      [user_info] => SELECT id, name FROM civicrm_state_province WHERE country_id IN () ORDER BY name [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 ') ORDER BY name' at line 1]
      [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT id, name FROM civicrm_state_province WHERE country_id IN () ORDER BY name [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 ') ORDER BY name' at line 1]"]
      )

      Everythin in Drupal is working great. And I did already do a "myisamchk -r" on all the tables.

      I need to use CiviCRM a.s.a.p.! Any help on what to do would be greatly appreciated!!!

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              Anonymous
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: