Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Tworzenie tabel
Forum PHP.pl > Forum > Bazy danych > MySQL
aren
W manualu mysql czytamy http://pl.php.net/http://dev.mysql.com/doc...data-types.html

M indicates the maximum display width for integer types. For floating-point and fixed-point types, M is the total number of digits that can be stored. For string types, M is the maximum length. The maximum allowable value of M depends on the data type.

INT[(M)] [UNSIGNED] [ZEROFILL]

A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295" title="Zobacz w manualu PHP" target="_manual">http://dev.mysql.com/doc/refman/5.0/en/data-types.html
M indicates the maximum display width for integer types. For floating-point and fixed-point types, M is the total number of digits that can be stored. For string types, M is the maximum length. The maximum allowable value of M depends on the data type.

INT[(M)] [UNSIGNED] [ZEROFILL]

A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295

Wiec czy w przypadku int(m) max(m) = 10 ? jesli wiec zrobie int(2) max z tego bedzie 99 ?
Norbas
Przecież napisali:
Cytat
... M indicates the maximum display width for integer types ...

Służy do określenia maksymalnej szerokości wyświetlania dla typów całkowitych
Cytat
... jesli wiec zrobie int(2) max z tego bedzie 99 ?

Nie. Z manuala:
Cytat
The display width does not constrain the range of values that can be stored in the column, nor the number of digits that are displayed for values having a width exceeding that specified for the column.

When used in conjunction with the optional extension attribute ZEROFILL, the default padding of spaces is replaced with zeros. For example, for a column declared as INT(5) ZEROFILL, a value of 4 is retrieved as 00004. Note that if you store larger values than the display width in an integer column, you may experience problems when MySQL generates temporary tables for some complicated joins, because in these cases MySQL assumes that the data fits into the original column width.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.