Reply to Re: varchar problem

Your name:

Reply:


Posted by Terry on 06/18/05 15:16

Geoff Berrow wrote:
> I noticed that Message-ID: <42b378b7$1_1@spool9-west.superfeed.net> from
> Terry contained the following:
>
>
>>I apparently do not correctly understand varchar - everything I have
>>read indicates that text entered into a MySQL table with varchar
>>characteristics will automatically have any space characters stripped
>
>>from both ends of the line.
>
> Where have you read that? A space is just another character. If you
> want to strip them, use trim().
>
From page 123 of "PHP and MySQL for Dynamic Web Sites" by Larry Ullman:
---------
Heading "Char vs. Varchar"
One primary difference between the two is that anything stored as CHAR
will always be stored as a string the length of the column (using spaces
to pad it). Coversely, VARCHAR strings will only be as long as the
stored string itself.
---------
- a google search yielded simular results.

The filename (row[0]) is varchar and has no extra spaces.
Some of the entries (row[3]) have leading spaces - most do not.
Additionaly, I did not put any spaces in - why should I have to strip them?

--
TK
http://www.wejuggle2.com/
Still Having a Ball







..

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация