The error you have is telling you at least one record in your XML has something other than a valid integer for either $xmlCategoryID or $xmlLeafCategory.
What to do?
A. You could have your error message display the offending data, something like this:
echo "Error occurred: " . mysqli_error($link);
echo "Bad data was either ##$xmlCategoryID## or ##$xmlLeafCategory##.";
Notice that I used ##$value## so you can detect empty strings in your error messages. You probably should do this.
B. You could try changing your column definitions for those columns to remove the NOT NULL declaration. If in fact one of those values is empty, this may fix your problem.
C. It's possible that you need bigint
values for this information. That is, they could be very large numbers.
D. If you don't care enough about null or bad values to bother to detect them you could try this.
INSERT INTO `ebay_categories`
(`CategoryID`, `LeafCategory`)
VALUES
(CAST(IFNULL('$xmlCategoryID',-1) AS INT)
(CAST(IFNULL('$xmlLeafCategory',-1) AS INT)
This will turn null values into -1 and non-integer values into 0.
Edit: Oh, I understand now. Your leafCategory item isn't a number in XML, it's a true/false/empty value. Presumably false and empty mean the same thing.
Try this, using a SQL case statement to translate true/other to 1/0.
INSERT INTO `ebay_categories`
(`CategoryID`, `LeafCategory`)
VALUES (
'$xmlCategoryID',
CASE '$xmlLeafCategory' WHEN 'true' THEN 1 ELSE 0 END
)
Finally, danger! You need to use prepared statements, and you need to sanitize these values you're extracting from your XML file. If you don't somebody will be able to trick your software into destroying your database by feeding it a poisoned XML file. Please read up on SQL injection.