开发者

Storing a User's Signature in MySQL

开发者 https://www.devze.com 2023-01-18 08:19 出处:网络
I need to store user\'s signature (ie the thing at the bottom of a forum post) and am not sure how to, 开发者_JAVA百科I could use text to store the html, but I think there are probably better solution

I need to store user's signature (ie the thing at the bottom of a forum post) and am not sure how to, 开发者_JAVA百科I could use text to store the html, but I think there are probably better solutions.


I see no sense in this question. What's so special with this particular field?
Is it the only one field in this database?
if no - why it's only one raised such a question?

Why not to determine first, what field length will suit you, and then choose appropriate field type according to documentation?


A text field is OK for that. You could use a big varchar field also. But you will have to check and inform your user that there is a limit on the size of his/her signature (which is fine).


A text field is probably the best. If you are worried about the "structure" of the signature, you may use the nl2br() function in PHP, which will convert any new line character stored in the field into the HTML <br/>.

0

精彩评论

暂无评论...
验证码 换一张
取 消