Re: varchar problem
- From: Terry <tknospa@xxxxxxxxxxxxx>
- Date: Sat, 18 Jun 2005 07:16:07 -0500
Geoff Berrow wrote:
From page 123 of "PHP and MySQL for Dynamic Web Sites" by Larry Ullman:I noticed that Message-ID: <42b378b7$1_1@xxxxxxxxxxxxxxxxxxxxxxxxx> 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().
---------
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 =---- .
- Follow-Ups:
- Re: varchar problem
- From: Tony
- Re: varchar problem
- From: Andy Hassall
- Re: varchar problem
- References:
- varchar problem
- From: Terry
- Re: varchar problem
- From: Geoff Berrow
- varchar problem
- Prev by Date: Re: $_SESSION; more specific
- Next by Date: Re: varchar problem
- Previous by thread: Re: varchar problem
- Next by thread: Re: varchar problem
- Index(es):
Relevant Pages
|