odata-client-php icon indicating copy to clipboard operation
odata-client-php copied to clipboard

Special characters not working in where condition

Open ravatsinh opened this issue 2 years ago • 3 comments

$q->where('field_name', '=', "test'value")->get();

Getting error {"error":{"code":"BadRequest","message":"There is an unterminated literal at position.........

ravatsinh avatar Dec 16 '22 04:12 ravatsinh

Looks like you're missing a single quote after 'field_name

anderly avatar Dec 16 '22 15:12 anderly

Looks like you're missing a single quote after 'field_name

Sorry updated now But issue in test'value single quate

ravatsinh avatar Dec 16 '22 15:12 ravatsinh

You may need to escape your single quote using \'.

Example: $q->where('field_name', '=', "test\'value")->get();

anderly avatar Sep 06 '23 16:09 anderly