We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34004
    • 125 Posts
    I have an object which inserts a number:

    $filedata['EventId'] = (int)$eventId;


    I have verified this is in the $filedata object using var_dump:

     ["EventId"]=>int(14941836435)


    However when it inserts the number changes to 2147483647 huh I have no idea how this happens. in mysql the EventId column is an INT 20.

    When I change the code to

    $filedata['EventId'] = (int)22

    or
    $filedata['EventId'] = 22;


    It inserts 22 correctly. I have no idea where 2147483647 is coming from. Any ideas? [ed. note: ficklelife last edited this post 8 years, 5 months ago.]
      • 34004
      • 125 Posts
      Got it. It's the maximum value of an INT. Need to use BIGINT.