I want to store HTML and PHP in mysql db开发者_如何学编程, i'm unsure as to what field type i should use TEXT or BLOB?
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.
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.
精彩评论