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) »
  • Error message when try to add a new contribution
Pages: [1]

Author Topic: Error message when try to add a new contribution  (Read 809 times)

mgregoire

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 0
Error message when try to add a new contribution
May 20, 2010, 02:44:47 am
Hi everybody,

I have a problem, when I try to add a contribution, the following messa ge is displayed :

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_pledge.contact_id = 3532' at line 3, 1064


The details are :

Code: [Select]

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

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
SELECT civicrm_pledge.id id
FROM civicrm_pledge
WHERE civicrm_pledge.status_id   IN (,,)       
  AND civicrm_pledge.contact_id = 3532
 [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_pledge.contact_id = 3532' at line 3]
    [type] => DB_Error
    [user_info] =>
SELECT civicrm_pledge.id id
FROM civicrm_pledge
WHERE civicrm_pledge.status_id   IN (,,)       
  AND civicrm_pledge.contact_id = 3532
 [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_pledge.contact_id = 3532' at line 3]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
SELECT civicrm_pledge.id id
FROM civicrm_pledge
WHERE civicrm_pledge.status_id   IN (,,)       
  AND civicrm_pledge.contact_id = 3532
 [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_pledge.contact_id = 3532' at line 3]"]
)


Many thanks for the help![/code]

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Error message when try to add a new contribution
May 21, 2010, 09:47:18 am
Where I would start with this one is the following:

1. Look up Contact #3532 and see what is the deal with this record.  You are trying to add a Contribution but something is erroring with the Pledge.
  a. does this contact have any pledges?
  b. do you use pledges in your database?
  c. have pledges been turned off?

2. What kind of contribution are you trying to add?

3. Where are you adding the contribution from?  From the contact's record or another location?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Error message when try to add a new contribution
May 24, 2010, 05:26:59 am
mgregoire :
Can you make sure all the option values corresponding to option group "contribution_status" are enabled for your set up?

You might wanna refer to :
http://drupal.demo.civicrm.org/civicrm/admin/optionValue?reset=1&action=browse&gid=11

or alternately fire a query to check the values are in place as:
Code: [Select]
mysql>  SELECT  v.name as name ,v.value as value, v.grouping as grouping
    -> FROM   civicrm_option_value v,
    ->             civicrm_option_group g
    -> WHERE  v.option_group_id = g.id
    ->   AND  g.name            = 'contribution_status'
    ->   AND  v.is_active       = 1
    ->   AND  g.is_active       = 1;
+-------------+-------+----------+
| name        | value | grouping |
+-------------+-------+----------+
| Cancelled   | 3     | NULL     |
| Completed   | 1     | NULL     |
| Failed      | 4     | NULL     |
| In Progress | 5     | NULL     |
| Overdue     | 6     | NULL     |
| Pending     | 2     | NULL     |
+-------------+-------+----------+

6 rows in set (0.00 sec)

HTH
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Andrew Perry

  • I post occasionally
  • **
  • Posts: 98
  • Karma: 1
  • Building empowering tools that comply with rules
    • Community Builders Australia
  • CiviCRM version: 3.x, 4.x
  • CMS version: Joomla 1.0.x, 1.5.x -> Drupal 6.x, 7.x, WordPress
  • MySQL version: 5.1, 5.5, 5.6
  • PHP version: 5.2, 5.3, 5.4
Re: Error message when try to add a new contribution
June 23, 2010, 12:39:23 am
We were having a similar problem and this helped a lot - thanks!!
Community Builders Australia Pty Ltd
www.communitybuilders.com.au

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Error message when try to add a new contribution

This forum was archived on 2017-11-26.