Nawwar Elnarsh
Nawwar Elnarsh

Reputation: 1069

What is max integer value for mysqli prepared statement?

After asking and reading many q/a here I newly started a new project using prepared statments

my question is about types

mysqli_stmt->bind_param ( string $types , mixed &$var1 [, mixed &$... ] )

for $types i : is integer okay what is it's max value ... can it handle bigint ?

Upvotes: 0

Views: 287

Answers (1)

Paul Kotets
Paul Kotets

Reputation: 209

maximum value of int that is handled by 32 bit MySQL is 2147483647 and yes, you can handle bigger ints just check it's value before binding param and if it's greater than 2147483647 use type 's' instead of 'i'. MySQL will handle it itself, I use this method for seven years already

Upvotes: 2

Related Questions