Can't save long text for product / category / article / blog description in OpenCart? There can be several reasons why long text is not saved in the MySQL database. In this article, we will list a few reasons why this may 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 long text. The data type should be TEXT or LONGTEXT depending on the length of the text you want to save. If the data type of the column is not set correctly, it may not be able to hold long text. MySQL has a limit on the maximum length of data in a field. If the text you are trying to save exceeds this limit, it will not be saved in its entirety and may be truncated. Open the 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 blog table or any other table. If necessary, change the field type to one that allows you to store more data. Field types and restrictions are listed below:
Type | Approx. Length | Exact Max. Length Allowed |
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 could be the encoding of the text. MySQL supports different character sets, and if the encoding used for the text is not supported by the database, it may not be stored. Check the encoding used for the text and make sure it is supported by MySQL. The problem can also be caused by a database size limit if the size limit of the entire database has been reached. If the database has reached the size limit, it will not be able to store additional data.
If none of the above solutions work, there may be other issues that need to be investigated. It may be helpful to consult with your MySQL database administrator or technical support team to help resolve the issue.