Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ 32-bit and 64-bit integer in PHP and MySQL range     - BGP routers want to play it by CentOS (Linux)

- Erase do with HTML5 Canvas and diffusion effect (Programming)

- The istgt PSD on ported to Mac OS X (Linux)

- PostgreSQL export data dictionary documents (Database)

- Open MySQL slow query log (Database)

- Learning OpenCV: (VS2010-openCV2.4.3-win7 configuration instructions) (Linux)

- Linux mention the right notes (Linux)

- Detailed software to run UnixBench (Linux)

- MongoDB query timeout exception SocketTimeoutException (Database)

- Linux top command to get started (Linux)

- Why do you need close contact Rust 1.0 (Programming)

- Linux process or thread is bound to a CPU (Programming)

- RHEL 7.1 compile and install Ganglia 3.7.1 (Server)

- Httpclient4.4 of principle (Http execution context) (Programming)

- Jump table (skiplist) of code (Programming)

- xCAT Installation Kit (Linux)

- Linux System Getting Started Learning: On Linux how to convert text files to PDF (Linux)

- PLSQL Developer synchronization table tools (Database)

- RabbitMQ installation, configuration, monitoring (Linux)

- How to set up FTP server on Linux (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:      
 
- Why did not Oracle privileges can also log in with sysdba (Database)
- Ubuntu mysql stop fail to solve the problem (Database)
- To install Docker under CentOS7 (Linux)
- Linux Operating System Security Management describes the top ten tricks (Linux)
- CentOS7 build GlusterFS (Linux)
- Sorting algorithm of dichotomy (binary) insertion sort algorithm (Programming)
- Linux CentOS configuration SVN + SVN hook (Server)
- Download Manager uGet 2.0 installed in Debian, Ubuntu, Linux Mint and Fedora (Linux)
- Connect to the Oracle Database Help class (Database)
- The correct method to modify the maximum number of concurrent connections Tomcat 7 (Server)
- Grep how to find files based on file contents in UNIX (Linux)
- Django1.8 return json json string and the string contents of the received post (Programming)
- Oracle can not change the tablespace to backup mode in non-archive mode (Database)
- After installing Ubuntu 15.04, to do a few things (Linux)
- Lua and C ++ (Programming)
- Linux Nginx FastDFS integration module is installed Nginx and FastDFS (Server)
- Android in the coordinate system and a method to obtain the coordinates (Programming)
- FreeBSD install Gnome 3 Desktop (Linux)
- Java how to achieve bubble sort the problem Arraylist (Programming)
- Ubuntu install virtual machine software VirtualBox 4.3.10 (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.