1

I want to store HTML and PHP in mysql db, i'm unsure as to what field type i should use TEXT or BLOB?

2 Answers 2

4

Text (if it is code) unless you want to store the php/html file itself, blob is meant for binary data such as images and files.

Sign up to request clarification or add additional context in comments.

Comments

0

Yup... that would be funny to search it... and if you do put html into a db, don't plan on using phpMyAdmin, or at least older versions of it. Can make quite a mess.

Generally the "commonality" uses flat-files (like .tpl files) for the html. This keeps your DB clean, and remember large amounts of data in a single field can produce somewhat slow results.

Also For search options, you will have to write code to surpass any html tags from the text. This can be done but needs to be coded properly.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.