Answers.Body: <p>This is because of a missing field in the contribution log table. See the following question and answer for next steps:
  <a href="https://civicrm.stackexchange.com/questions/8706/how-can-i-deal-with-a-missing-or-corrupt-binary-advanced-log-table">How can I deal with a missing or corrupt binary (&quot;advanced&quot;) log table?</a></p>
  
  <p>So if you don't care about existing logs, you should just be able to turn logging off then back on, otherwise that post gives some more advice.</p>
  
  <p>For either step, I'd suggest <strong>backing up your database first</strong> just in case something gets more corrupted.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T23:15:07.180Z
Answers.Text: Actually turning logging off & back on will not lose any data (the tables are not recreated but extra fields are added when you turn back on).
  
  You do stand to lose any logging data you would have otherwise captured over the few minutes while you are turning it off & on
Answers.UserDisplayName: user4278
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T22:57:24.377Z
Answers.LastActivityDate: 2018-05-02T22:57:24.377Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>Invoice number is a field that was added some releases earlier than the version you are on - perhaps you need to run the upgrade script by hitting civicrm/upgrade url - although I'm not quite sure how to construct that url in Joomla!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T15:09:34.730Z
Answers.Text: I have attempted that but i get an error message that indicates the database has already been upgraded to 4.7.30. I also checked the table and that field is present.
Answers.UserDisplayName: Tom Barnes
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T15:33:12.200Z
Answers.Text: Might be a trigger that is corrupted. Try SHOW TRIGGERS and see if any reference invoice_number. I say this because the query in the question post doesn't even use the field directly.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T18:39:17.397Z
Answers.Text: How do I show triggers
Answers.UserDisplayName: Tom Barnes
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T18:51:07.807Z
Answers.Text: It's a mysql command, so however you access your database, e.g. phpmyadmin.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T21:55:44.267Z
Answers.Text: There is an after insert trigger that copies all of the cells to the contribution log table. I checked and that table does not have the invoice_number field. Sounds like either a bug or the database did not update completely. How do you suggest I resolve it?
Answers.UserDisplayName: Tom Barnes
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T22:57:41.797Z
Answers.Text: Have answered in the answer section.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T23:12:04.903Z
Answers.Text: I went ahead and added the field to the log_contribution table. It turned out I also had to add three missing fields to the log_activity table but it is now working.
Answers.UserDisplayName: Tom Barnes
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T13:03:36.607Z
Answers.LastActivityDate: 2018-05-02T13:03:36.607Z
Answers.UserDisplayName: user4278
Body: <p>We are getting a DB Error: no such field error when registering for a paid event. Here is the debug info which indicated a problem with an unknown column in the contributions table I think. I have looked and that field is in the table. We are using CiviCRM 4.7.30 on Joomla 3.8.7</p>
  
  <p>Database Error Code: Unknown column 'invoice_number' in 'field list', 1054
  Additional Details:</p>
  
  <p>Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => handle
          )</p>
  
  <pre><code>[code] =&gt; -19
  [message] =&gt; DB Error: no such field
  [mode] =&gt; 16
  [debug_info] =&gt; INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , total_amount , fee_amount , net_amount , invoice_id , currency , source , amount_level , is_test , is_pay_later , contribution_status_id , check_number , tax_amount ) VALUES ( 17049 ,  6 ,  1 ,  20180501090413 ,  50 ,  0 ,  50 , '5e4ba6329f63217b6b65a068eafabfe1' , 'USD' , 'Online Event Registration: Childrens Camp (1st - 7th Grades) 2018 Counselor and Staff Application' , 'Application Fee - 1' ,  0 ,  0 ,  2 ,  NULL ,  0 )  [nativecode=1054 ** Unknown column 'invoice_number' in 'field list']
  [type] =&gt; DB_Error
  [user_info] =&gt; INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , total_amount , fee_amount , net_amount , invoice_id , currency , source , amount_level , is_test , is_pay_later , contribution_status_id , check_number , tax_amount ) VALUES ( 17049 ,  6 ,  1 ,  20180501090413 ,  50 ,  0 ,  50 , '5e4ba6329f63217b6b65a068eafabfe1' , 'USD' , 'Online Event Registration: Childrens Camp (1st - 7th Grades) 2018 Counselor and Staff Application' , 'Application Fee - 1' ,  0 ,  0 ,  2 ,  NULL ,  0 )  [nativecode=1054 ** Unknown column 'invoice_number' in 'field list']
  [to_string] =&gt; [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , total_amount , fee_amount , net_amount , invoice_id , currency , source , amount_level , is_test , is_pay_later , contribution_status_id , check_number , tax_amount ) VALUES ( 17049 ,  6 ,  1 ,  20180501090413 ,  50 ,  0 ,  50 , '5e4ba6329f63217b6b65a068eafabfe1' , 'USD' , 'Online Event Registration: Childrens Camp (1st - 7th Grades) 2018 Counselor and Staff Application' , 'Application Fee - 1' ,  0 ,  0 ,  2 ,  NULL ,  0 )  [nativecode=1054 ** Unknown column 'invoice_number' in 'field list']"]
  </code></pre>
  
  <p>)</p>
  
Tags: <civievent><civicontribute><joomla>
Title: DB Error: no such field On Event Registration
ThreadText: # DB Error: no such field On Event Registration
  
  (Asked by: username_0 on 2018-05-02)
  
  We are getting a DB Error: no such field error when registering for a paid event. Here is the debug info which indicated a problem with an unknown column in the contributions table I think. I have looked and that field is in the table. We are using CiviCRM 4.7.30 on Joomla 3.8.7
  
  Database Error Code: Unknown column 'invoice\_number' in 'field list', 1054
  Additional Details:
  
  Array
  (
  [callback] => Array
  (
  [0] => CRM\_Core\_Error
  [1] => handle
  )
  
  ```
  [code] => -19
  [message] => DB Error: no such field
  [mode] => 16
  [debug_info] => INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , total_amount , fee_amount , net_amount , invoice_id , currency , source , amount_level , is_test , is_pay_later , contribution_status_id , check_number , tax_amount ) VALUES ( 17049 ,  6 ,  1 ,  20180501090413 ,  50 ,  0 ,  50 , '5e4ba6329f63217b6b65a068eafabfe1' , 'USD' , 'Online Event Registration: Childrens Camp (1st - 7th Grades) 2018 Counselor and Staff Application' , 'Application Fee - 1' ,  0 ,  0 ,  2 ,  NULL ,  0 )  [nativecode=1054 ** Unknown column 'invoice_number' in 'field list']
  [type] => DB_Error
  [user_info] => INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , total_amount , fee_amount , net_amount , invoice_id , currency , source , amount_level , is_test , is_pay_later , contribution_status_id , check_number , tax_amount ) VALUES ( 17049 ,  6 ,  1 ,  20180501090413 ,  50 ,  0 ,  50 , '5e4ba6329f63217b6b65a068eafabfe1' , 'USD' , 'Online Event Registration: Childrens Camp (1st - 7th Grades) 2018 Counselor and Staff Application' , 'Application Fee - 1' ,  0 ,  0 ,  2 ,  NULL ,  0 )  [nativecode=1054 ** Unknown column 'invoice_number' in 'field list']
  [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , total_amount , fee_amount , net_amount , invoice_id , currency , source , amount_level , is_test , is_pay_later , contribution_status_id , check_number , tax_amount ) VALUES ( 17049 ,  6 ,  1 ,  20180501090413 ,  50 ,  0 ,  50 , '5e4ba6329f63217b6b65a068eafabfe1' , 'USD' , 'Online Event Registration: Childrens Camp (1st - 7th Grades) 2018 Counselor and Staff Application' , 'Application Fee - 1' ,  0 ,  0 ,  2 ,  NULL ,  0 )  [nativecode=1054 ** Unknown column 'invoice_number' in 'field list']"]
  
  ```
  
  )
  
  **Tags:** civievent, civicontribute, joomla
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-05-02. Score: 1
  
  This is because of a missing field in the contribution log table. See the following question and answer for next steps:
  [How can I deal with a missing or corrupt binary ("advanced") log table?](https://civicrm.stackexchange.com/questions/8706/how-can-i-deal-with-a-missing-or-corrupt-binary-advanced-log-table)
  
  So if you don't care about existing logs, you should just be able to turn logging off then back on, otherwise that post gives some more advice.
  
  For either step, I'd suggest **backing up your database first** just in case something gets more corrupted.
  
  > **Comments:**
  > **username_2**: Actually turning logging off & back on will not lose any data (the tables are not recreated but extra fields are added when you turn back on).  You do stand to lose any logging data you would have otherwise captured over the few minutes while you are turning it off & on  
  
  ---
  
  ### Answer by username_2 on 2018-05-02. Score: 0
  
  Invoice number is a field that was added some releases earlier than the version you are on - perhaps you need to run the upgrade script by hitting civicrm/upgrade url - although I'm not quite sure how to construct that url in Joomla!
  
  > **Comments:**
  > **username_0**: I have attempted that but i get an error message that indicates the database has already been upgraded to 4.7.30. I also checked the table and that field is present.  
  > **username_1**: Might be a trigger that is corrupted. Try SHOW TRIGGERS and see if any reference invoice_number. I say this because the query in the question post doesn't even use the field directly.  
  > **username_0**: How do I show triggers  
  > **username_1**: It's a mysql command, so however you access your database, e.g. phpmyadmin.  
  > **username_0**: There is an after insert trigger that copies all of the cells to the contribution log table. I checked and that table does not have the invoice_number field. Sounds like either a bug or the database did not update completely. How do you suggest I resolve it?  
  > **username_1**: Have answered in the answer section.  
  > **username_0**: I went ahead and added the field to the log_contribution table. It turned out I also had to add three missing fields to the log_activity table but it is now working.  
  
  ---
  
  