Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ 32-bit and 64-bit integer in PHP and MySQL range     - Linux 0.12 kernel and modern kernels difference in memory management (Linux)

- AngularJS application unit testing started (Programming)

- Sysdig: system troubleshooting tool (Linux)

- How to download video youtube-dl in Linux (Linux)

- Migrate Oracle database files to ASM (Database)

- Linux SSH commands (Linux)

- CentOS / Linux SELinux Close (Linux)

- Getting Started with Linux system to learn: how to install USB webcams come in raspberry (Linux)

- Linux yum command Detailed (Linux)

- Linux firewall rules example Extracts (Linux)

- To install and deploy PHP environment under the CentOS (Server)

- A key installation Gitlab 7 on RHEL6.4 and Setup Mail TX (Linux)

- Three kinds of implementation model of the Linux thread history (Programming)

- MySQLbinlog combat on using data recovery (Database)

- Use the TC flow control test under Linux (Linux)

- How to write a new Git protocol (Linux)

- Help you enhance Python programming languages 27 (Programming)

- Linux System Getting Started Learning: Statistical process a number of threads in Linux (Linux)

- How to determine whether the Linux server was hacked (Linux)

- Linux ln command - create a file / directory link (Linux)

 
         
  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:      
 
- Ubuntu and Derivatives users install the latest KKEdit 0.0.31 (Linux)
- Under CentOS yum install Nginx smooth switch mounted to Tengine (Server)
- CentOS7 virtual machine starts appear Permission denied (Linux)
- Windows Remote Desktop Management CentOS 6.4 (Linux)
- Create and modify Oracle temporary table space (Database)
- To install Ganglia (Linux)
- OpenVPN offsite interconnecting room availability and load balancing solution (Server)
- Design and implementation of environment sniffer running under Linux (Linux)
- Installation and Configuration OpenVPN server and client on Ubuntu 15.04 (Server)
- Ubuntu use three methods to install Ruby (Linux)
- Compile and install Redis and register as a system service under RedHat5.8 environment (Database)
- Java static internal class (Programming)
- Linux disk virtualization (Linux)
- To install GCC development environment under SUSE11 (Linux)
- Make Linux more secure server tips (Linux)
- Linux support exFAT and NTFS (Linux)
- Linux command line under HTTP traffic sniffing tool: httpry (Linux)
- Each catalog Detailed Linux (Linux)
- Installation and use GAMIT / GLOBK Software (Linux)
- Upgrading Oracle 11.2.0.1.0 to 11.2.0.3.0 (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.