ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:integer_metatypes

This is an old revision of the document!


Integer MetaTypes

Size Table

Meta TypeTypeStorage SizeSigned RangeUnsigned Range
I1TINYINT1 byte-128 to 1270 to 255
I2SMALLINT2 bytes-32,768 to 32,7670 to 65,535
I4MEDIUMINT3 bytes-8,388,608 to 8,388,6070 to 16,777,215
IINT / INTEGER4 bytes-2,147,483,648 to 2,147,483,6470 to 4,294,967,295
I8BIGINT8 bytes-9,223,372,036,854,775,808 to 9,223,372,036,854,775,8070 to 18,446,744,073,709,551,615

Key Notes

SIGNED vs UNSIGNED

By default, integers are SIGNED (can store negative and positive values). Adding UNSIGNED allows only non-negative values but doubles the positive range.

Performance Considerations

Use the smallest type that fits your data to save storage and improve performance.

v5/userguide/integer_metatypes.1773287168.txt.gz · Last modified: by mnewnham