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 Error: value count on row - Database Error Code: Column count doesn't match v
Pages: [1]

Author Topic: DB Error: value count on row - Database Error Code: Column count doesn't match v  (Read 6250 times)

anders

  • Guest
DB Error: value count on row - Database Error Code: Column count doesn't match v
December 02, 2009, 12:41:43 pm
I get this message after logging in to paypal and about to confirm the contribution.

Code: [Select]
Sorry. A non-recoverable error has occurred.
DB Error: value count on row

Database Error Code: Column count doesn't match value count at row 1, 1136

Return to home page.

Error Details:

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

    [code] => -22
    [message] => DB Error: value count on row
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_financial_trxn (contribution_id , trxn_date , trxn_type , total_amount , fee_amount , net_amount , currency , payment_processor , trxn_id ) VALUES ( 9 ,  20091202211610 , 'Debit' ,  5 ,  2.97 ,  2,03 , 'NOK' , 'PayPal_Express' , '7DH65234B61010402' )  [nativecode=1136 ** Column count doesn't match value count at row 1]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_financial_trxn (contribution_id , trxn_date , trxn_type , total_amount , fee_amount , net_amount , currency , payment_processor , trxn_id ) VALUES ( 9 ,  20091202211610 , 'Debit' ,  5 ,  2.97 ,  2,03 , 'NOK' , 'PayPal_Express' , '7DH65234B61010402' )  [nativecode=1136 ** Column count doesn't match value count at row 1]
    [to_string] => [db_error: message="DB Error: value count on row" code=-22 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_financial_trxn (contribution_id , trxn_date , trxn_type , total_amount , fee_amount , net_amount , currency , payment_processor , trxn_id ) VALUES ( 9 ,  20091202211610 , 'Debit' ,  5 ,  2.97 ,  2,03 , 'NOK' , 'PayPal_Express' , '7DH65234B61010402' )  [nativecode=1136 ** Column count doesn't match value count at row 1]"]
)

How can I fix this?[/code]

anders

  • Guest
Re: DB Error: value count on row - Database Error Code: Column count doesn't mat
December 02, 2009, 03:51:53 pm
I think the error has something to do with the decimals. NOK which is the Norwegian currency uses , as the decimal separator.

From this: (contribution_id , trxn_date , trxn_type , total_amount , fee_amount , net_amount , currency , payment_processor , trxn_id )
and: ( 9 ,  20091202211610 , 'Debit' ,  5 ,  2.97 ,  2,03 , 'NOK' , 'PayPal_Express' , '7DH65234B61010402' ).

The fee_amount is stated to be 2.97 and net_amount to be 2,03. Maybe the "," makes a new column in the database causing the error. If this is the case, how do I fix it?

anders

  • Guest
Re: DB Error: value count on row - Database Error Code: Column count doesn't mat
December 03, 2009, 04:44:40 pm
Is it possible to use str_replace(',','.',$params) in the paypalImpl.php found in the CiviCRM/CRM/Core/Payments ?

anders

  • Guest
Re: DB Error: value count on row - Database Error Code: Column count doesn't mat
December 03, 2009, 07:57:31 pm
I'm setting up CiviCRM with contribution with paypal
[04:43] <Anderswo> however, I'm recieving 2 different errors
[04:43] <Anderswo> I use the module PayPal_Express btw
[04:44] <Anderswo> First error (when confirming the payment): Column count doesn't match value count at row 1
[04:45] <Anderswo> This is caused because the net_amount use ',' as a decimal separator and not '.'. Causing it to make an extra coloumn.
[04:45] <Anderswo> When I try to insert the values directly through phpmyadmin i get "A foreign key constraint".
[04:46] <Anderswo> What to do?
[04:49] <Anderswo> I've read on the forums. And I have deleted some contacts ref: http://forum.civicrm.org/index.php?topic=9500.0 Can this be causing one of the problems?
[04:54] <Anderswo> Error from phpmyadmin: #1452 - Cannot add or update a child row: a foreign key constraint fails (`admin_nettkortet/civicrm_financial_trxn`, CONSTRAINT `FK_civicrm_financial_trxn_contribution_id` FOREIGN KEY (`contribution_id`) REFERENCES `civicrm_contribution` (`id`) ON DELETE CASCADE)  
[05:00] <dlobo> u should track down and see how the number 2,03 is generated
[05:00] <dlobo> and who is generating it?
[05:00] <dlobo> seems like it should be 2.03
[05:00] <dlobo> since 2,03 is more the display format
[05:01] <Anderswo> Line 169 on PayPalImpl.php under crm/core/payments
[05:01] <Anderswo> okey :)
[05:07] <Anderswo> I've tried to fix this by editing the file on line 166-167 and 170-177 or so New PayPalImpl.php: http://pastie.org/726917 , old PayPalImpl.php: http://pastie.org/726921
« Last Edit: December 03, 2009, 08:15:25 pm by anders »

doctorfalken

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Re: DB Error: value count on row - Database Error Code: Column count doesn't match v
April 15, 2010, 05:35:05 am
Hi!!

I had the same problem ... Any solution? ???

mgregoire

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 0
Re: DB Error: value count on row - Database Error Code: Column count doesn't match v
April 15, 2010, 08:40:08 am
Hi there,

I have also the same problem!

Is a solution found?

Many thanks by advance.
« Last Edit: April 15, 2010, 09:52:11 am by mgregoire »

marlutin

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
Re: DB Error: value count on row - Database Error Code: Column count doesn't match v
April 26, 2010, 01:20:20 pm
Sorry to post only to tell that I have the same problem with french version unsing "," as currency separator.

But maybe someone knows where to edit/change the ',' for a '.'

The sql treats the data as numbers or floating and not as text, so a clean workaround is not expectable very soon I think.
Who can help for a quick'n dirty solution on the source of the problem?

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: DB Error: value count on row - Database Error Code: Column count doesn't match v
April 27, 2010, 06:38:31 pm
I have tested with a clean 3.1.4 install, with Paypal standard, in fr_FR, and could not reproduce the problem. I did a full regular 1$ transaction.

Can you activate backtrace (CiviCRM > Admin > Global > Debug) and post a full backtrace?

mathieu
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • DB Error: value count on row - Database Error Code: Column count doesn't match v

This forum was archived on 2017-11-26.