easydb
easydb copied to clipboard
insertGet return null if MySQL table contains JSON type field
insertGet('table', ['text_field' => 'text', 'json_field' => json_encode([1,2,3])], 'id') will not return 'id'
Does your table have an id field? The JSON is likely a red herring.
Does your table have an
idfield? The JSON is likely a red herring.
Yep. id - INT (autoincrement) and primary key. insertGet work as expected if I change JSON data type to TEXT. But in this case I can't use benefits of JSON fields.
Oh, interesting.
https://github.com/paragonie/easydb/blob/79760589dbc2d77c83825dcd565f070dabfa23e2/src/EasyDB.php#L691-L709
This logic might be invalid for a JSON field.