Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ 32-bit and 64-bit integer in PHP and MySQL range     - Kernel compile under Debian (Linux)

- Install Ruby on Rails in Ubuntu 15.04 in (Linux)

- Apache Web Security Linux systems (Linux)

- MySQL tmpdir parameter modification (Database)

- MySQL Tutorial: Some optimized for I / O memory areas (Database)

- Linux rename command usage in learning to modify the file name (Linux)

- Tecplot Installation under Linux (Linux)

- Windows SmartGit installation (Linux)

- Linux Operating System Security Management Experience (Linux)

- Linux System Getting Started Tutorial: Installing Git on Linux (Linux)

- I use the desktop environment in GNU / Linux combination tool (Linux)

- How MySQL tracking sql statement (Database)

- CentOS7 method to upgrade the kernel to 3.18 (Linux)

- Install Firefox 32 official version of the Linux system (Linux)

- Use FFmpeg processing high quality GIF (Programming)

- Ubuntu 15.10 / 14.04 install subtitling software Aegisub (Linux)

- Oracle 10g, 11g database silent installation of small differences (Database)

- HttpClient4 usage upgrade from HttpClient3 (Programming)

- To compile and install Redis Linux and master-slave replication configuration (Database)

- Revive Adserver ad server installation on Ubuntu 15.04 / CentOS7 (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:      
 
- Qt signals and slots mechanism (Programming)
- Detailed steps - GAMIT solver (Linux)
- Installation and Configuration ISC DHCP server on Debian Linux (Server)
- CentOS 6.5 dual card configuration, one of the external network, a local area network connection (Linux)
- How Linux system password security guarantee (Linux)
- Understand ASP.NET 5 running the command: DNVM, DNX, and DNU (Server)
- Postgres-X2 deployment steps (Database)
- Linux character device - automatically creates the device nodes and devices (Linux)
- Linux virtual machines to solve end MySQL database can not remote access (Database)
- redis main building and disaster recovery from a cluster deployment (Database)
- Debian 8 (amd64) installation deployment Memcached management tools MemAdmin (Server)
- Graphing tool: Gnuplot (Linux)
- How x2go set up Remote Desktop on Linux (Linux)
- Advanced network security tips Linux backdoor Technology and Practice (Linux)
- How to use the character in C ++ without pressing the Enter key to enter the Show (Programming)
- Linux kernel update error, update-initramfs: failed Solution (Linux)
- Puppet centralized configuration management system (Server)
- To install Ganglia (Linux)
- CentOS 6.5 installation and deployment SVN 1.8.10 (Linux)
- Ubuntu 14.04.02 LTS startup items erroneous writing / dev / sda1 (win 7 loader) Repair (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.