Skip to content

Conversation

@albertcht
Copy link
Contributor

@albertcht albertcht commented Jan 25, 2021

Hi there,

When you try to batch insert/update a boolean-type value, a false value will be converted to empty string which leads to failure in mysql query.

$final[$field][] = 'WHEN `' . $index . '` = \'' . $val[$index] . '\' THEN ' . $value . ' ';

So in this pull request, I convert the boolean values to 1 or 0 in mysql_escape function to prevent this error.

if (is_bool($fieldValue)) { return (int) $fieldValue; }

All the best~

@mavinoo mavinoo merged commit 1fbd6cb into mavinoo:master Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants