longtext

Prepared mysqli select statement on longtext field is coming back empty

让人想犯罪 __ 提交于 2019-11-28 11:20:29
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 running the query through phpMyAdmin works fine. According to http://www.workinginboxershorts.com/php-mysqli-returns-empty-variables-from-longtext-column , switching the datatype to text solves the problem. However, in my case I'd really prefer to leave the field as longtext as I can foresee times when that extra space would be valuable. I'm using

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

拟墨画扇 提交于 2019-11-27 12:03:47
问题 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 struggled with motivating myself to make the minute change because "what's the harm?" hence the question. 回答1: The only storage size difference is the number of bytes allocated for the "how many bytes is this field" number. From the fine manual:

Prepared mysqli select statement on longtext field is coming back empty

↘锁芯ラ 提交于 2019-11-27 06:14:35
问题 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 running the query through phpMyAdmin works fine. According to http://www.workinginboxershorts.com/php-mysqli-returns-empty-variables-from-longtext-column, switching the datatype to text solves the problem. However, in my case I'd really prefer to leave

Trouble with GROUP_CONCAT and Longtext in MySQL

落爺英雄遲暮 提交于 2019-11-26 21:41:44
问题 The SQL... UPDATE Threads t SET t.Content = ( SELECT GROUP_CONCAT(a.Content ORDER BY a.PageID SEPARATOR '<!-- pagebreak -->') FROM MSarticlepages a WHERE a.ArticleID = t.MSthreadID GROUP BY a.ArticleID ) As you can see it takes all of an article's pages (which are each stored as longtext in separate rows) and GROUP_CONCATs them into a single longtext row. The problem is the results are only so many characters and then it gets completely truncated, losing about 90% of the contents. Does CONCAT