I need to store user's signature (ie the thing at the bottom of a forum post) and am not sure how to, I could use text to store the html, but I think there are probably better solutions.
+1
A:
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).
Pablo Santa Cruz
2010-10-03 14:04:10
Does it need a specific length? If I leave it blank will it default to unlimited?
Ell
2010-10-03 14:05:31
`varchar` does need length.
Pablo Santa Cruz
2010-10-03 14:29:15
+2
A:
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?
Col. Shrapnel
2010-10-03 14:14:42
Well I'm a complete MySQL noob and I wasn't sure if it was appropriate to store a signature in the actual database or if I should contain a url to link to a html file, I just thought that storing large chunks of data in the database may have bad side effects.
Ell
2010-10-04 16:49:05
@Ell so you gonna say that it's the first piece of data you are going to store? Not forum posts or threads are your concern but just a "signature"?
Col. Shrapnel
2010-10-04 17:44:48
very good point, I was realy just forward thinking, but after a little thought, seeing as though I'm a complete noob in php and MySQl, maybe a forum is a little ambitious. I will probably use phpbb anyway, but thanks for the input! :)
Ell
2010-10-04 21:57:18
A:
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/>
.
sorro
2010-10-03 20:01:26
I'd say that text field is way too much for a signature and varchar(255) would be enough
Col. Shrapnel
2010-10-03 20:02:46
There are plenty of forums where signature can be longer than 255 characters, though. It all depends on what s/he wants to do with the signature field...
sorro
2010-10-03 20:04:11