By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

which is better? varchar, file, BLOB

P: 52
I have a page in which users send messages to each other (something like orkut)
and I have to store the messages.

What will be a good way to store these messages.

I thought of 3 options

First, I can just store the messages in mysql database creating a column for messages like
Expand|Select|Wrap|Line Numbers
  1. message varchar (200)
but doing so limits the length of the message to 200.

Second, I can store the messages in a file for each user.
Is there something in PHP like lseek in C ?

Third, I am not sure how to handle BLOB, but I read somewhere it is used to store binary data of large size, so will it be possible to do that for the messages?

I am not sure what the professionals use

Can I get any standard codes for these type of operations ?

Dec 28 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 5K+
P: 6,050
Why not just increase the amount of characters allowed in the cell?
message varchar(1000)

Using a database, to me, is the most appropriate way to do things.
Keeps everything tody and manageable.

Dec 28 '07 #2

P: 52

Thanks for your suggestion.
I thought of doing that, but won't that waste much space.
Say, a message is just 10 characters long, then won't it occupy whole 1000 bytes in the disk?

Thanks again
Dec 28 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.