Hi DrByte,
I think the database columns in question are integers (or other numeric types) rather than strings. MySQL appears not to accept an empty value for such columns in INSERT statements (you would think it would apply the default, would you not?). The error message when num_cart_items was missing from the POST was something like:
[FONT="Courier New"]Invalid integer value: ''[/FONT]
(That's two adjacent single quotes there). Of course another solution would be to omit the column from the INSERT statement entirely if it is not preset in the POST. It's the empty value that trips up MySQL.
I'm only guessing here, but PayPal may have changed the contents of their IPN POST's. That would explain why this problem has suddenly started occurring. And / or it may be that this problem is specific to MySQL 5. MySQL is not my field of expertise.
Anyway, I hope that is all clear. Suggestion:
Code:
$db->SetErrorHandler (MyDBErrorHandler);
function MyDBErrorHandler ($error_code, $error_msg)
...
And use this in ipn_main_handler.php to email (or log) any SQL error that occurs (and then die). Currently the script just outputs an error message that nobody ever sees. I would also email any other forms of failure to the administrator (e.g. INVALID), regardless of the debug setting. Such events signal a problem that the store owner should look into.
Good piece of software by the way, Zen Cart. You have left osCommerce far behind. Keep up the good work.