Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ 32-bit and 64-bit integer in PHP and MySQL range     - CentOS 7 virt-manager can not connect a local hypervisor (Linux)

- View and modify Linux machine name (Linux)

- Dom4j change XML coding (Programming)

- Orabbix binding Python send graphical reports (Linux)

- Add a custom encryption algorithm in OpenSSL (Linux)

- MySQL function: group_concat () function (Database)

- Java String and StringBuffer and StringBuilder Comments (Programming)

- Sublime Text - Opens the current file in a browser (Linux)

- Fast Sort Algorithms (Programming)

- C ++ containers (Programming)

- Memcached and Redis (Linux)

- Linux --- manual release system cache (Linux)

- Linux iptables: basic principles and rules (Linux)

- The Java ThreadLocal (Programming)

- Ease of use "Explain Shell" script to understand Shell command (Linux)

- Unix system security configuration (Linux)

- How wifi-linux AP signal strength detection (Linux)

- True and false in Perl (Programming)

- Build Docker based MongoDB replication cluster environment (Database)

- How to install Kernel 4.0.2 on CentOS 7 (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:      
 
- JavaScript basic tools list (Programming)
- MySQL5.7 JSON type using presentation (Database)
- Start Linux ISO image directly from the hard disk (Linux)
- How to Install Sticky Notes on Ubuntu and Derivatives (Linux)
- C ++ sequence containers basics summary (Programming)
- STL spatial Configurator (Programming)
- Docker installation under CentOS7 (Linux)
- SSH without password (Linux)
- Hackers is how the invasion and control of Things devices? (Linux)
- Delegate in C # (Programming)
- Gitblit adopted Ticket collaborative development model (Linux)
- RHEL7 Apache MPM configuration (Server)
- Solve ORA-01012: not logged on (Database)
- Defensive programming in PHP (Programming)
- Acting on JavaScript events (Programming)
- After reloading the cinder-volume OpenStack not start properly (Server)
- Security: Unix operating system intrusion tracking Strikes Back (Linux)
- Linux System Getting Started Learning: The Linux log (Linux)
- Some practical tips Linux (Linux)
- Chkconfig set boot start under Linux (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.