|
-
Jan 29th, 2006, 05:09 AM
#1
Thread Starter
Member
MySQL - only 255 char ?
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 ...) ?
-
Jan 29th, 2006, 06:25 AM
#2
Hyperactive Member
Re: MySQL - only 255 char ?
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.
PHP Code:
$sql0="CREATE TABLE posts (
post text NOT NULL,
TYPE=InnoDB ;";
That can have unlimited characters for the posts 
Rudi
-
Jan 29th, 2006, 07:45 AM
#3
Re: MySQL - only 255 char ?
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|