So I am working on a small project and using PHP/MySQL so far.
I wanted to know how do I go on storing very long text (let's say a user inputs a lot of paragraphs at once). Is using SQL for saving the text a good idea? Or should I save the huge amount of text using some other method instead?
Thanks!
EDIT: Forgot to mention I am currently using LONGTEXT to store the text. I just wanted to know if it's a good approach to store such amount of text in a db.
It's fine to store long text in Mysql database, just make sure you use appropriate column type in mysql database:
TEXT - Holds a string with a maximum length of 65,535 characters
MEDIUMTEXT - Holds a string with a maximum length of 16,777,215 characters
LONGTEXT - Holds a string with a maximum length of 4,294,967,295 characters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With