mysql代码存在哪,在mysql中存储html代码

Here is the scenario,

I am using MVC(Model,View,Controller) structure in my application.The platform which I am using isCake PHPand my database is in mysql.

I am allowing the user to make changes in an element of the page,mainly div element/container.I will achieve the goal by using Ajax and JQuery,but the main question is of saving the changed content.

I have though of saving the entire html code in the database but I am not quiet sure about the retreiving part of it..

So need suggestion on this topic,regarding the way of appoarch that I should use.

If I should use database for saving the contents then which of the two datatype(text or thumbblob) is better for such a field.

Any Help would be highly appreciated.

解决方案Since all HTML is text, I see no advantage to using a datatype reserved for binary information. Even images are sent using text based formats in http/https. The only advantage to storing it in binary is that you will use less space, but you will also have to encode and decode the binary information for use in http/https. Overall, it is not worth the hassle you will encounter, in my opinion.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值