Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ 32-bit and 64-bit integer in PHP and MySQL range     - MySQL master-slave delay problem (Database)

- Detailed Linux su command to switch users Mistakes (Linux)

- How to modify the Linux NIC eth1 to eth0 (Linux)

- After the first remote installation GlassFish Web to remotely access their back office management system error solution appears (Server)

- The wrong in Linux: too many open files (Linux)

- CentOS How to mount the hard drive (Linux)

- Linux crontab command format example (Linux)

- Raspberry Pi configuration wireless hotspot (Linux)

- Java is simple to read and write HDFS Demo (Programming)

- Linux kernel TCP / IP parameters analysis and tuning (Linux)

- To update Python version under CentOS system (Linux)

- Android system source code and compile the kernel source code (Programming)

- Python script file directory traversal examples (Programming)

- Android imageView in the Src and Background (Programming)

- AngularJS notes --- Data Binding (Programming)

- Nginx Load Balancing (standby) + Keepalived (Server)

- XP virtual machine under VirtualBox solve occupy 100% CPU problem (Linux)

- Formatting Java floating-point types (Programming)

- RHEL5 stalled due to power service error system can not start (Linux)

- To remove those IP is prohibited Fail2ban on CentOS 6/7 (Server)

 
         
  32-bit and 64-bit integer in PHP and MySQL range
     
  Add Date : 2018-11-21      
         
         
         
 

A byte is 8 bits, so 32-bit int type occupies 32/8 = 4 bytes, 64-bit int type occupies 64/8 = 8 bytes.

32-bit, 64-bit unsigned integer Max:
2 ^ 64-1 = 18446744073709551615
  2 ^ 32-1 = 4294967295

  32-bit, 64-bit signed integer Max:
  (2 ^ 32) / 2-1 = 2147483647
  (2 ^ 64) / 2-1 = 9223372036854775807

1 is reduced because an integer including 0.

  64 Wei Ubuntu 14.04, PHP_INT_MAX value 9223372036854775807, with MySQL bigint type in the maximum symbol of the same
32 Wei Ubuntu 14.04, PHP_INT_MAX value of 2147483647, signed with MySQL. int type as the maximum
echo date ( 'Ymd H: i: s', PHP_INT_MAX); return 2038-01-19 11:14:07
  echo strtotime (' 2038-01. -19 11:14:07 '); return 2147483647
  echo strtotime (' 2038-01-19 11:14:08 '); 32 bits The following returns an empty
  That is, PHP on the system of time 32 bit () returns only the largest timestamp 2038-01-19 11:14:07.

field types: `posted` int (10) unsigned NOT NULL DEFAULT '0'
  on 32-bit MySQL (64 Wei MySQL too), than insert a 32-bit unsigned int type Max 2 ^ 32-1 = 4,294,967,295 larger number error occurs:
UPDATE `punbb`.`pb_topics` SET` posted` = '4294967296' WHERE `pb_topics`.`id` = 1;
  Warning: # 1264 Out of range value for column 'posted' at row 1
However, MySQL can use 8-byte bigint type to store 64-bit integers

     
         
         
         
  More:      
 
- B-tree - ideas and implementation of C language code (Programming)
- After installing minimize RHEL / CentOS 7 need to do some things (Linux)
- CentOS 6.6 install JDK7 (Linux)
- The several technical presentation Raid under Linux (Linux)
- Java inner classes (Programming)
- Android system source code and compile the kernel source code (Programming)
- Use PDFBox processing PDF documents (Linux)
- Ubuntu 14.10 / Linux Mint 17.1 Win10 compiler install rdesktop 1.8.3 Remote Desktop connection (Linux)
- Linux operating system security management skills notes (Linux)
- Ubuntu 15.04 installed JDK and configured as the default JDK (Linux)
- Android memory optimization of the memory cache (Linux)
- Unetbootin make use U disk loading Linux system (Linux)
- Linux landing problem (Linux)
- CentOS6.5 install SVN & visual management tools iF.SVNAdmin (Server)
- Three kinds of binary tree traversal recursive and iterative solution (Programming)
- Setting Wetty do not need an account login command line operations (Linux)
- PXE installation of Linux servers (Server)
- PHP generates a random password several ways (Programming)
- Install Xshell on Mac OS X (Linux)
- Python 2 Chinese garbage problem solved (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.