Bekijk Volledige Versie : Spaties in MySQL VARCHAR
Nico Schuyt
18/11/06, 14:36
Volgens de specificaties* worden spaties verwijderd uit VARCHAR-velden vanaf
versie 5.0.3.
Op server A en B staat beide MySQL versie 5.0.22
A (PHP 5.2) verwijdert spaties wel, B (PHP 5.1.4) niet.
Kan PHP ook van invloed zijn?
* <http://dev.mysql.com/doc/refman/5.0/en/char.html>
VARCHAR values are not padded when they are stored. Handling of trailing
spaces is version-dependent. As of MySQL 5.0.3, trailing spaces are retained
when values are stored and retrieved, in conformance with standard SQL.
Before MySQL 5.0.3, trailing spaces are removed from values when they are
stored into a VARCHAR column; this means that the spaces also are absent
from retrieved values.
--
Nico Schuyt
http://www.nicoschuyt.nl/
Ronald Klip
18/11/06, 14:36
Op 17-11-2006 08:44 schreef Nico Schuyt:
> Volgens de specificaties* worden spaties verwijderd uit VARCHAR-velden vanaf
> versie 5.0.3.
Juist niet, afgaande op je citaat.
> Op server A en B staat beide MySQL versie 5.0.22
> A (PHP 5.2) verwijdert spaties wel, B (PHP 5.1.4) niet.
> Kan PHP ook van invloed zijn?
Lijkt mij stug. Zit er niet stiekum een trim() in je script?
> * <http://dev.mysql.com/doc/refman/5.0/en/char.html>
> VARCHAR values are not padded when they are stored. Handling of trailing
> spaces is version-dependent. As of MySQL 5.0.3, trailing spaces are retained
> when values are stored and retrieved, in conformance with standard SQL.
> Before MySQL 5.0.3, trailing spaces are removed from values when they are
> stored into a VARCHAR column; this means that the spaces also are absent
> from retrieved values.
>
--
groet, Ronald
Nico Schuyt
18/11/06, 14:36
Ronald Klip wrote:
> Nico Schuyt:
>> Volgens de specificaties* worden spaties verwijderd uit
>> VARCHAR-velden vanaf versie 5.0.3.
> Juist niet, afgaande op je citaat.
Je hebt helemaal gelijk
>> Op server A en B staat beide MySQL versie 5.0.22
>> A (PHP 5.2) verwijdert spaties wel, B (PHP 5.1.4) niet.
>> Kan PHP ook van invloed zijn?
> Lijkt mij stug. Zit er niet stiekum een trim() in je script?
Ehhhh, inderdaad werd er in het ene geval bij inlezen vanuit tekstbestand
getrimd
Stom stom ....
> * <http://dev.mysql.com/doc/refman/5.0/en/char.html>
--
Nico Schuyt
http://www.nicoschuyt.nl/
Ronald Klip
18/11/06, 14:36
Op 18-11-2006 07:48 schreef Nico Schuyt:
> Ronald Klip wrote:
>> Nico Schuyt:
>
>>> Volgens de specificaties*
>> Juist niet,
> Je hebt helemaal gelijk
>>> Kan PHP ook van invloed zijn?
>> Lijkt mij stug.
> Ehhhh, inderdaad
> Stom stom ....
Zo zie je maar, een luisterend oor is het halve werk, ofzo ;)
--
groet, Ronald
Nico Schuyt
18/11/06, 14:36
Ronald Klip wrote:
> Nico Schuyt:
>> Ronald Klip wrote:
>>> Nico Schuyt:
>>>> Volgens de specificaties*
>>> Juist niet,
>> Je hebt helemaal gelijk
>>>> Kan PHP ook van invloed zijn?
>>> Lijkt mij stug.
>> Ehhhh, inderdaad
>> Stom stom ....
> Zo zie je maar, een luisterend oor is het halve werk, ofzo ;)
Inderdaad :-)
Bedankt!
--
Nico Schuyt
http://www.nicoschuyt.nl/