$ Currency

Long description text is not being saved in OpenCart?

Unable to save a long product / category / blog article description in OpenCart? There can be several reasons why long text is not being saved to the MySQL database. In this article we will outline a …

Long description text is not being saved in OpenCart?

Unable to save a long product / category / blog article description in OpenCart? There can be several reasons why long text is not being saved to the MySQL database. In this article we will outline a few reasons why this might happen.

Check the type of the description field in the database table

You need to check the data type of the column in which you are trying to save the long text. The data type should be TEXT or LONGTEXT depending on the length of the text you want to store. If the column data type is set incorrectly, it may not fit the long text. MySQL has a limit on the maximum data length in a field. If the text you are trying to save exceeds this limit, it will not be stored in full and may be truncated. Open your database control panel, for example phpMyAdmin, and make sure that the length of the text you are trying to save does not exceed the maximum length of the "description" column in the oc_product_description or oc_category_description table, or the blog table, or any other one. If needed, change the field type to one that allows storing more data. The field types and limits are listed below:

DB field type Size Maximum length
TINYTEXT 256 bytes 255 characters
TEXT 64 kilobytes 65,535 characters
MEDIUMTEXT 16 megabytes 16,777,215 characters
LONGTEXT 4 gigabytes 4,294,967,295 characters

Other possible reasons

Another possible reason can be the text encoding. MySQL supports different character sets, and if the encoding used for the text is not supported by the database, it may not be saved. Check the encoding used for the text and make sure it is supported by MySQL. The issue can also occur due to database size limits, if the size limit of the entire database has been reached. If the database has reached its size limit, it will not be able to store additional data.

If none of the above solutions works, there may be other issues that need to be investigated. It can be helpful to consult with a MySQL database administrator or the technical support team to help resolve the issue.

Contact via Telegram Contact via Telegram