I have a table:
CREATE TABLE `cr_runnerEntrant` (
`AutoId` int(10) NOT NULL AUTO_INCREMENT,
`BibNumber` int(4) DEFAULT NULL,
`eb_checked_in` int(4) DEFAULT NULL,
`alphaCountryCode` varchar(2) DEFAULT NULL,
`timeAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`AutoId`)
) ENGINE=MyISAM AUTO_INCREMENT=13354115 DEFAULT CHARSET=utf8;
I fetch some JSON from another server and insert it have some code:
$filedata['alphaCountryCode'] = $attendee['profile']['addresses']['home']['country'];
$filedata['eb_checked_in'] = intval($attendee['checked_in']); // converts JSON true or false into 1 or 0
$filedata['BibNumber'] = intval($attendee['assigned_number']);
$addEntrant = $modx->newObject('RunnerEntrant');
$addEntrant->fromArray($filedata);
$addEntrant->save();
when I print $filedata I get:
array(18) {
["alphaCountryCode"]=>
string(2) "GB"
["eb_checked_in"]=>
int(1) // or int(0) depending if true or false
["BibNumber"]=>
int(6)
}
alphaCountryCode, BibNumber work fine and insert into the db no worries, but eb_checked_in is always NULL. I can't figure it out, bibNumber is an INT, eb_checked_in is all set up the same - php says it's an INT, but it won't insert. Any clues as to how I can debug this? Thanks