<p>Does your database have InnoDB enabled and are all of Craft's tables using it (except for <code>searchindex</code>, which is MyISAM)? Sounds like maybe when you deleted the field some cascading deletes that are set on foreign keys didn't occur and that can happen if you're on MyISAM (which doesn't have foreign key support).</p>

CC BY-SA 3.0
2015-08-31T20:04:12.213Z
I just checked the admin/utils and it has MySQL InnoDB support with a green tick beside it so I assume it's enabled.
On checking the status: SHOW TABLE STATUS FROM `db`;
All tables areusing InnoDB apart from the craft_searchindex which is MyISAM - should it be InnoDB as well?
mmc501
CC BY-SA 3.0
2015-08-31T20:41:04.017Z
craft_searchindex is the odd one out (needs to do full text searches)
Marion Newlevant
CC BY-SA 3.0
2015-08-31T17:26:11.770Z
2015-08-31T21:12:25.263Z
2015-08-31T21:12:25.263Z
Brad Bell
<p>I ran into this issue recently updating a Craft 3.0.37 site to 3.2.x </p>

<p>The issue turned out to be SuperTable plugin which also needed to be updated to more recent version.</p>

CC BY-SA 4.0
2019-10-25T15:56:42.890Z
2019-10-25T15:56:42.890Z
Alex Aguilar
<p>I am trying to update an entry in a structure but getting the error:</p>

<pre><code>CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nisp.craft_matrixcontent_colcontent' doesn't exist. The SQL statement executed was: SELECT `elements`.`id`, `elements`.`type`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_i18n`.`slug`, `elements_i18n`.`uri`, `elements_i18n`.`enabled` AS `localeEnabled`, `content`.`id` AS `contentId`, `matrixblocks`.`fieldId`, `matrixblocks`.`ownerId`, `matrixblocks`.`ownerLocale`, `matrixblocks`.`typeId`, `matrixblocks`.`sortOrder`
 FROM `craft_elements` `elements`
 JOIN `craft_elements_i18n` `elements_i18n` ON elements_i18n.elementId = elements.id
 JOIN `craft_matrixcontent_colcontent` `content` ON content.elementId = elements.id
 JOIN `craft_matrixblocks` `matrixblocks` ON matrixblocks.id = elements.id
 WHERE ((((((elements_i18n.locale = :locale) AND (content.locale = :locale)) AND (elements.archived = 0)) AND (elements.enabled = 1)) AND (elements_i18n.enabled = 1)) AND (matrixblocks.fieldId=:matrixblocksfieldId1)) AND (matrixblocks.ownerId=:matrixblocksownerId1)
 GROUP BY `elements`.`id`
 ORDER BY `matrixblocks`.`sortOrder` LIMIT 100. Bound with :locale='en_gb', :matrixblocksfieldId1='285', :matrixblocksownerId1='1656' 
</code></pre>

<p>The table it mentions is a matrix related table which does not exist - it was deleted a while back.
It was used in a Matrix - Super Table - Matrix test but I was getting errors with it and decided not to use this then so deleted it.
I only started to get this error when I added a new Matrix Field to this entryType. But I have emvoed the Matrix field and now I am still getting the error and can't update.
Any idea's as to the resolution?</p>

CC BY-SA 3.0
2015-08-31T07:58:55.433Z
Have you cleared all your caches?
Marion Newlevant
CC BY-SA 3.0
2015-08-31T09:05:49.590Z
Yep tried that.
mmc501
<matrix><entry><error-message>
Unable to Update Entry - Table doesn't exist
# Unable to Update Entry - Table doesn't exist

(Asked by: username_0 on 2015-08-31)

I am trying to update an entry in a structure but getting the error:
CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nisp.craft_matrixcontent_colcontent' doesn't exist. The SQL statement executed was: SELECT `elements`.`id`, `elements`.`type`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_i18n`.`slug`, `elements_i18n`.`uri`, `elements_i18n`.`enabled` AS `localeEnabled`, `content`.`id` AS `contentId`, `matrixblocks`.`fieldId`, `matrixblocks`.`ownerId`, `matrixblocks`.`ownerLocale`, `matrixblocks`.`typeId`, `matrixblocks`.`sortOrder`
 FROM `craft_elements` `elements`
 JOIN `craft_elements_i18n` `elements_i18n` ON elements_i18n.elementId = elements.id
 JOIN `craft_matrixcontent_colcontent` `content` ON content.elementId = elements.id
 JOIN `craft_matrixblocks` `matrixblocks` ON matrixblocks.id = elements.id
 WHERE ((((((elements_i18n.locale = :locale) AND (content.locale = :locale)) AND (elements.archived = 0)) AND (elements.enabled = 1)) AND (elements_i18n.enabled = 1)) AND (matrixblocks.fieldId=:matrixblocksfieldId1)) AND (matrixblocks.ownerId=:matrixblocksownerId1)
 GROUP BY `elements`.`id`
 ORDER BY `matrixblocks`.`sortOrder` LIMIT 100. Bound with :locale='en_gb', :matrixblocksfieldId1='285', :matrixblocksownerId1='1656' 

The table it mentions is a matrix related table which does not exist - it was deleted a while back.
It was used in a Matrix - Super Table - Matrix test but I was getting errors with it and decided not to use this then so deleted it.
I only started to get this error when I added a new Matrix Field to this entryType. But I have emvoed the Matrix field and now I am still getting the error and can't update.
Any idea's as to the resolution?

**Tags:** matrix, entry, error-message

> **Comments:**
> **username_1**: Have you cleared all your caches?  
> **username_0**: Yep tried that.  

---

## 2 answers

### Answer by username_2 on 2015-08-31. Score: 1

Does your database have InnoDB enabled and are all of Craft's tables using it (except for `searchindex`, which is MyISAM)? Sounds like maybe when you deleted the field some cascading deletes that are set on foreign keys didn't occur and that can happen if you're on MyISAM (which doesn't have foreign key support).

> **Comments:**
> **username_0**: I just checked the admin/utils and it has MySQL InnoDB support with a green tick beside it so I assume it's enabled. On checking the status: SHOW TABLE STATUS FROM `db`; All tables areusing InnoDB apart from the craft_searchindex which is MyISAM - should it be InnoDB as well?  
> **username_1**: craft_searchindex is the odd one out (needs to do full text searches)  

---

### Answer by username_3 on 2019-10-25. Score: 1

I ran into this issue recently updating a Craft 3.0.37 site to 3.2.x

The issue turned out to be SuperTable plugin which also needed to be updated to more recent version.


---

