foreach($HTTP_POST_VARS['arrayMainAct'] as $key=>$value) { $MainAct = $MainAct ." " .$value; } $MainAct = $MainAct . " "; // I add a final space
But when I add $MainAct to a record, the last space isn't included. Any help how to avoid this?
The column datatype has to be CHAR, not VARCHAR. From the manual:
Values in VARCHAR columns are variable-length strings. You can declare a VARCHAR column to be any length between 1 and 255, just as for CHAR columns. However, in contrast to CHAR, VARCHAR values are stored using only as many characters as are needed, plus one byte to record the length. Values are not padded; instead, trailing spaces are removed when values are stored. (This space removal differs from the SQL-99 specification.)
http://www.mysql.com/doc/en/CHAR.html
Originally posted by tomhath The column datatype has to be CHAR, not VARCHAR. From the manual: http://www.mysql.com/doc/en/CHAR.html
Actually, my column type is TEXT. I already have a lot of data stored in this column, will a change to CHAR affect this (for exampling a reset to a default value) ?
Originally posted by Thierry Actually, my column type is TEXT. I already have a lot of data stored in this column, will a change to CHAR affect this (for exampling a reset to a default value) ?
I tested the change on a copy of the database, and it didn't work...
But i already sorted it out using the TEXT column.