I am currently reading from the PHP and MySQL 2nd Edition Dummies book. And I am kind of stuck on what this means. I seem not to understand it. Any help greatly appreciated. On the book, I am on page 57, and on the section about Variable-length format. It says:
"In this format, MySQL stores the string in a field that is the same length as the string. You still specify a length for the string, but if the string is shorter than the specified length, MySQL only uses the space required rather than leaving the extra space empty. If the string is longer than the space specified, the extra characters are not stored."
OK. So basically, what I think this means is that for instance if the field is specified with a length of 10. If the string is shorter than the specified length, MySQL ignores the extra space required, and uses the string as it is. If the string is longer than the specified space, the extra characters aren't stored.
Well, if that's true, its kind of the same like a fixed-length format, but oh well. If it isn't, please could you correct me. Thanks.
Ben.
"In this format, MySQL stores the string in a field that is the same length as the string. You still specify a length for the string, but if the string is shorter than the specified length, MySQL only uses the space required rather than leaving the extra space empty. If the string is longer than the space specified, the extra characters are not stored."
OK. So basically, what I think this means is that for instance if the field is specified with a length of 10. If the string is shorter than the specified length, MySQL ignores the extra space required, and uses the string as it is. If the string is longer than the specified space, the extra characters aren't stored.
Well, if that's true, its kind of the same like a fixed-length format, but oh well. If it isn't, please could you correct me. Thanks.
Ben.







