Questions tagged [longtext]

129 questions
32
votes
2 answers

What is the disadvantage to using a MySQL longtext sized field when every entry will fit within a mediumtext sized field?

What is the disadvantage to using a MySQL longtext sized field when every entry will fit within a mediumtext sized field? The reason I am asking is because I have some longtext sized fields and recently realized they are much too large, but then…
darkAsPitch
  • 1,755
  • 3
  • 22
  • 34
30
votes
4 answers

Limit length of longtext field in SELECT results

I'm executing a SELECT query on a table in MySQL using the command-line interface (not a GUI client): SELECT * FROM blog_entry; One of blog_entry's fields is of type 'longtext' and is such a long piece of text that when the result is displayed in…
maxm
  • 4,407
  • 7
  • 25
  • 32
20
votes
10 answers

JPA: "Data too long for column" does not change

One of my entities Machinery has got a String property called notes. JPA 2-Hibernate generates the schema for me, in my case the RDBMS is a MySQL. notes is created as a VARCHAR(255) column, which is right. Users begin to create records and all works…
Fabio B.
  • 8,375
  • 22
  • 96
  • 167
16
votes
4 answers

Output array in Twig

I trying to output an array from the database to the screen. In my entity: /** * @ORM\Column(type="array", nullable=true) */ private $category; In my twig template: {% for category in user.profile.category %} {{ category }} {% endfor…
nowiko
  • 2,349
  • 6
  • 29
  • 69
14
votes
3 answers

Translating longer texts (view and email templates) with gettext

I'm developing a multilingual PHP web application, and I've got long(-ish) texts that I need to translate with gettext. These are email templates (usually short, but still several lines) and parts of view templates (longer descriptive blocks of…
lanzz
  • 38,081
  • 8
  • 81
  • 91
13
votes
4 answers

How to handle long text in preferences on Android?

Background I'm making an app that has some settings, and I want to use the built in PreferenceActivity or PreferenceFragment for the job The problem Some of the preferences have a long title which I cannot shorten, plus I think that if I ever…
android developer
  • 106,412
  • 122
  • 641
  • 1,128
12
votes
3 answers

SQL Error 1406 Data too long for column

I am trying to execute the query below in MySQL but get the SQL error 1406 Data too long for column error every time. The column data type is longtext. Any ideas? UPDATE `my_db`.`my_table` SET `content` = '
Frank Martin
  • 1,279
  • 1
  • 12
  • 17
12
votes
5 answers

EditText ellipsize (three dots...)

Unfortunatelly I am not able to make ellipsize for EditText works. Is even possible to put three dots at the end of the text when the text is too long? It is working perfectly for TextiView but not for EditText. Some idea? …
AdaMoOo
  • 397
  • 2
  • 4
  • 11
11
votes
5 answers

BLOB/TEXT column 'bestilling' used in key specification without a key length

I am trying to make a order system, but I am stuck right now. In the mysql tabel right now, I am using varchar(255) in a column named "bestillinger", but it can only store 255 chars. So I searched a bit, and remembered that i could use longtext or…
Ismail
  • 229
  • 1
  • 4
  • 15
7
votes
1 answer

Prepared mysqli select statement on longtext field is coming back empty

I've got a database query function that works well -- except that I'm running into what's apparently a known issue with mysqli prepared statements and longtext fields. What happens is that the longtext field always comes up empty even though…
Sean Cunningham
  • 2,588
  • 5
  • 21
  • 33
5
votes
2 answers

MySQL - LONGTEXT field causes hang in SELECT-WHERE statement

I am having an issue due to LONGTEXT field. Everything works fine, but when a SELECT query is executed with any WHERE clause in it, the mysql goes to sleep and never returns. There are only 80k records and explicit WHERE comparison works fine. (Some…
Raheel Hasan
  • 5,044
  • 4
  • 33
  • 58
4
votes
1 answer

JPA native query for LONGTEXT field in a MySQL view results in error

I have the following JPA SqlResultSetMapping: @SqlResultSetMappings({ @SqlResultSetMapping(name="GroupParticipantDTO", columns={ @ColumnResult(name="gpId"), …
kosoant
  • 11,489
  • 7
  • 29
  • 37
4
votes
4 answers

Unable to save large text in mysql thru php

$query="INSERT INTO `ARTICLES` (`TITLE`, `BY`, `IN`, `POST`) VALUES('". $title ."', '". $by ."', '". $in ."', '". $_POST['post'] ."')"; This code is able to save small length text but not large. The datatype for the POST field is longtext. Also if…
draxxxeus
  • 1,513
  • 11
  • 14
4
votes
3 answers

Trouble with GROUP_CONCAT and Longtext in MySQL

The SQL... UPDATE Threads t SET t.Content = ( SELECT GROUP_CONCAT(a.Content ORDER BY a.PageID SEPARATOR '') FROM MSarticlepages a WHERE a.ArticleID = t.MSthreadID GROUP BY a.ArticleID ) As you can see it takes all of…
Iwasakabukiman
  • 1,433
  • 4
  • 15
  • 17
4
votes
1 answer

golang reading long text from stdin

I want to read a long text from os.Stdin, but I can't make it happen. Already read everything in the subject, tried codes that supposed to work. Every method cuts after 4096 characters, no matter what. Eg. here's a working example. After the first…
vendelin
  • 120
  • 1
  • 2
  • 11
1
2 3
8 9