How to insert string value to json field in postgree? json value :
my_json_record = "{'brandCode':'TOY',
'brandName':'TOYOTA',
'VehicleCollateral':{'ownerName':'Lode',
                       'CertificateNumber':'x123245'}
}"
I try to do this thing
$my_json_var = json_decode($my_json_record); insert into jsonx(json) value ( $my_json_var; )
and found this error. Query failed: ERROR: syntax error at or near “{“
can you help with my problem? Thx before..
Advertisement
Answer
JSON requires double quotes (“)