i want a field that could hold many, many, many lines of text.
data type?
thanks,
Sam
Printable View
i want a field that could hold many, many, many lines of text.
data type?
thanks,
Sam
longtext or longblob
thanks!!!
what's the max?
This is from MySQL docs:
Quote:
LONGBLOB
LONGTEXT
A BLOB or TEXT column with a maximum length of 4294967295 (2^32 - 1) characters.
why am I getting this error?
Error
MySQL said: You have an error in your SQL syntax near '(1000) not null ' at line 1
Back
Got it from phpMyAdmin, correct :) (looks so similar!)
Post the query here and let us analyze! :)
Field ==> status_report
Type ==> LONGTEXT
Length/Set ==> 1000
Attributes ==>
Null ==> not null
Default ==>
Extra ==>
Why not just use a 'text' field?
can it be 1000 long?
so what am I doing wrong?
so nobody knows?
When you set it up do not set a length... Do not worry about it. :)
what's the max? and what's the next highest?
Sam
Go check out column types in the documantation at http://www.mysql.com
i've tried looking at the documentation, but I can't find a clear answer.
just need the longest data type and it's max.
anyone who's experience with mysql should know this answer, it's simple.
sam
Just use longtext and do not put a value for it.
Restrict the number of characters on the client side....
BTW, this is the quickest and easiest solution. :)
From the mysql manual(took me 10 sec. to find it)Quote:
LONGTEXT
A BLOB or TEXT column with a maximum length of 4294967295 (2^32 - 1) characters. See section 7.7.1 Silent Column Specification Changes. Note that because the server/client protocol and MyISAM tables has currently a limit of 16M per communication packet / table row, you can't yet use this the whole range of this type.
LONGTEXT holds 4294967295 characters. you don't put a length on this type of field when defining it
IE
CREATE table test (
id INT(11) NOT NULL PRIMARY KEY,
text LONGTEXT
);
very cool. what's the max?
what would be the "other way?" :eek2:
Thanks,
Sam
thanks! appears that the last time that i tried using the longtext i was entering some invalid characters.
see for yourselves... http://www.dlgsolutions.com/test2.php3
username: c
password: c
thanks!
Sam
Isn't blob for holding binary files...not text...?
I don't know much about blob, never have to use that data type before. So what do you use blob for?