Click to See Complete Forum and Search --> : MySQL - only 255 char ?
salcman.vladimir
Jan 29th, 2006, 04:09 AM
I want to make chat or forum. Can you help me ? In database is only 255 characters. It's right ? I need more character in my database. How you make your databases (chat or forum ...) ?
..:RUDI:..
Jan 29th, 2006, 05:25 AM
Fields in tables can generally be whatever length you want, sometimes depending on the table type that you choose. I use InnoDB and for the posts, just specify the type as text, then unlimited...
This is a snippet from the install code of MageBB for creating the tables.
$sql0="CREATE TABLE posts (
post text NOT NULL,
TYPE=InnoDB ;";
That can have unlimited characters for the posts :)
Rudi
visualAd
Jan 29th, 2006, 06:45 AM
The way in which databases store their data means that character fields have a maximum length of 255 characters. The reason for this, is to make queries on the table faster. Variable length character fields often impose the same limit.
If you need to store large amounts of data in a specific field, you need to use binary large obects (BLOB)'s these allow you to srote up to 4GB of variable length data in each field.
Databases often store BLOB data in a separate file; again to make queries on the data faster.
As stated above by RUDI you need to set the datatype as BLOB or TEXT when you create the table. Have a look here for some more information: http://dev.mysql.com/doc/refman/5.0/en/blob.html
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.