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) »
  • DB syntax error when running gift aid report
Pages: [1] 2

Author Topic: DB syntax error when running gift aid report  (Read 5803 times)

Chelcone

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 1
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.*
  • MySQL version: MySQL 5.*
DB syntax error when running gift aid report
October 07, 2011, 01:08:59 am
Hi Everyone.

I have just managed to solve the issue with my gift aid module and the update for CiviCRM comes out for 3.4.6 so i tested it on my test server worked ok, didnt check the gift aid module module though. I went to run the Gift Aid batch and got to the point of confirming the results and creating the batch and got this error:

Code: [Select]
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 's Ford EASTLEIGH, SO53 5RT ', 'SO53 5RT', 55.00, 13.75)' at line 3, 1064
Additional Details:

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

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => REPLACE INTO civicrm_value_gift_aid_submission
(entity_id, eligible_for_gift_aid, name, address, post_code, amount, gift_aid_amount)
VALUES (48172, 1, 'Mrs. Patricia Grant', '3 Maytree Road
Chandler's Ford
EASTLEIGH, SO53 5RT
',
       'SO53 5RT', 55.00, 13.75) [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 's Ford
EASTLEIGH, SO53 5RT
',
       'SO53 5RT', 55.00, 13.75)' at line 3]
    [type] => DB_Error
    [user_info] => REPLACE INTO civicrm_value_gift_aid_submission
(entity_id, eligible_for_gift_aid, name, address, post_code, amount, gift_aid_amount)
VALUES (48172, 1, 'Mrs. Patricia Grant', '3 Maytree Road
Chandler's Ford
EASTLEIGH, SO53 5RT
',
       'SO53 5RT', 55.00, 13.75) [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 's Ford
EASTLEIGH, SO53 5RT
',
       'SO53 5RT', 55.00, 13.75)' at line 3]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="REPLACE INTO civicrm_value_gift_aid_submission
(entity_id, eligible_for_gift_aid, name, address, post_code, amount, gift_aid_amount)
VALUES (48172, 1, 'Mrs. Patricia Grant', '3 Maytree Road
Chandler's Ford
EASTLEIGH, SO53 5RT
',
       'SO53 5RT', 55.00, 13.75) [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 's Ford
EASTLEIGH, SO53 5RT
',
       'SO53 5RT', 55.00, 13.75)' at line 3]"]
)

Can anyone tell me what this means?

Thank you

Chel
« Last Edit: October 07, 2011, 01:23:02 am by Chelcone »

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: DB syntax error when running gift aid report
October 07, 2011, 07:46:48 am

Seems like the query does not use civicrm parameters to escape Strings etc

giftaid is a community contributed and supported module. Would be great if you can investigate and figure out a patch for this issue. Should be a fairly easy project to get into.

Ping us on IRC if u have any questions / need help getting started

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

Chelcone

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 1
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.*
  • MySQL version: MySQL 5.*
Re: DB syntax error when running gift aid report
October 07, 2011, 08:02:11 am
I have no experience coding. I have a very very limited knowledge of PHP.

I have sent a message to Michael McAndrew to see if he knows anything because a lot of charities that are UK based and use that module are going to run into issues. This is an issue directly with CiviCRM version 3.4.6 and this module. Anyone that does the upgrade is going to run into it. If I had the knowledge I would do it just to help everyone else out.

Chelcone

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: DB syntax error when running gift aid report
October 07, 2011, 08:17:33 am

i have patched it here:

http://svn.civicrm.org/tools/branches/v3.4/drupal/modules/civicrm_giftaid/GiftAid/Utils/Contribution.php

u can replace that file in your distribution or wait for the next release

there are other non-coding ways you can contribute and help improve civi. More ideas here:

http://en.flossmanuals.net/civicrm/civicrm-community/civicommunity/

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

Chelcone

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 1
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.*
  • MySQL version: MySQL 5.*
Re: DB syntax error when running gift aid report
October 10, 2011, 01:14:18 am
Thank you lobo.

I replaced the file in the module where it says in the SVN link. and i get this error when i try and run the batch.

Code: [Select]
Sorry. A non-recoverable error has occurred.
is not of type String

Any ideas?

Thank you for helping with this.

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: DB syntax error when running gift aid report
October 10, 2011, 06:10:35 am

i fixed a bug in the new code. can u re-download the file 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

Chelcone

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 1
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.*
  • MySQL version: MySQL 5.*
Re: DB syntax error when running gift aid report
October 10, 2011, 07:01:38 am
Used the same link as above and i still got the same error  ???

Code: [Select]
Sorry. A non-recoverable error has occurred.
is not of type String

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: DB syntax error when running gift aid report
October 10, 2011, 07:26:18 am

sorry cant help anymore since we dont really use giftaid.

Would be great if someone using that module can take a look and figure out whats happening

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

Chelcone

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 1
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.*
  • MySQL version: MySQL 5.*
Re: DB syntax error when running gift aid report
October 10, 2011, 07:46:08 am
is there a way of rolling back the database version? i have backups of the data but its since the upgrade. If i put the mysql files into a new server with the old version of Civi will the data still read?

Is there anyone we can pull in to look at this? i did message Michael who made the module but i have had no reply.

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: DB syntax error when running gift aid report
October 10, 2011, 07:58:47 am

Sorry, cant help here. Maybe someone else from the UK using the module will show up and be able to debug and patch

I think it will be a relatively easy thing to patch and fix

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

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: DB syntax error when running gift aid report
January 23, 2012, 06:52:26 am
I've been attempting to debug, but netbeans/xdebug is now hanging ("reporting error - unable to set watch on files in template_c" - though just why it is attempting to remains a mystery) - and so am I - hanging that is.

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: DB syntax error when running gift aid report
February 01, 2012, 09:33:09 am
Hey there,

Wasn't just me that made this module.  Was a community effort inc. people from Circle Interactive, Millertech, core team and others.  If you can post more on the problems you are having others might be able to help...
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

LindseyM

  • I post frequently
  • ***
  • Posts: 229
  • Karma: 8
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: DB syntax error when running gift aid report
February 03, 2012, 06:46:25 am
We're looking into using the Gift Aid module later this year.  Please can someone let me know if it's set up to work with Drupal 7?  Thanks.

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: DB syntax error when running gift aid report
February 03, 2012, 07:38:47 am

GiftAid is currently in a state of limbo, both the D6 version. Dont think anyone has ported it to D7 (which should be a minor task, IMO)

As i mentioned in another forum topic, it would be nice if a group of UK firms / orgs using GiftAid (hopefully other orgs than our normal suspects), would help support and maintain the module.

lindsey, care to lead that charge?

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

LindseyM

  • I post frequently
  • ***
  • Posts: 229
  • Karma: 8
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: DB syntax error when running gift aid report
February 03, 2012, 09:50:34 am
Hi lobo - will email you :)

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • DB syntax error when running gift aid report

This forum was archived on 2017-11-26.