473,800 Members | 2,365 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

which is better? varchar, file, BLOB

52 New Member
Hi
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 ?

Thanks
Dec 28 '07 #1
2 1077
Markus
6,050 Recognized Expert Expert
Why not just increase the amount of characters allowed in the cell?
[php]
message varchar(1000)
[/php]

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

:)
Dec 28 '07 #2
shreedhan
52 New Member
Hi

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

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

Similar topics

7
7103
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and disadvantages of using a MySQL blob field rather than reading the images directly from the file? How does one insert an image into a blob field? Can it be done dynamically? Thank you John
8
6278
by: Randell D. | last post by:
Folks, I once read an article in Linux Format whereby a technical writer had made performance recommendations on a LAMP environment. One of the points raised was for small columns in a database, that one is perhaps better off to trade a small waste of space for a gain on performance - The recommendation said that when you use VARCHAR(3) that MySQL searches for disk space to take a record that will accept a variable length value up to...
5
3409
by: rAinDeEr | last post by:
Hi, I have a web application with a table to store terms and conditions of a Company. This may some times run into many pages and some times it may be just a few sentences. It is a character text field. I want to know which Data type I need to use so that it doesnt waste memory. thanks in advance, rAinDeEr
2
14594
by: ROBUENO | last post by:
I NEED A WAY TO CONVERTER IN THE BASE DB2 DATAS TYPE (BLOB) INTO (VARCHAR/LONG VARCHAR) TO STORE IN A VIEW. I WORK WITH THE REPORT GENERATOR CRYSTAL REPORT AND INSIDE OF THE TOOL ENVIRONMENT I CAN´T CONVERTER VIA ODBC THE DATAS TO PRESENT IN THE REPORT.
0
9555
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10515
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10291
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10260
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6827
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5616
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4156
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3771
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.