[Vtigercrm-developers] Webservice Query for email address with ' (single quote) character

Martin Allen martin.allen at clystnet.com
Tue Apr 9 16:33:36 GMT 2019


Hi, Im trying to run a Webservice Query to look for a Contact by their
email address.
The email address in question contains a ' character (single quote) which
is a valid character for an email address to contain.

However I cannot structure a Query that will work with it
I have tried
$query = 'SELECT * FROM Contacts WHERE email = "test.'ing at example.com";';

but this returns an INTERNAL_SERVER_ERROR

and

$query = "SELECT * FROM Contacts WHERE email = 'test.'ing at example.com';";

but this returns
QUERY_SYNTAX_ERROR" ["message"]=> string(94) "Syntax Error on line 1: token
'ing' Unexpected COLUMNNAME(ing), expected one of: SEMICOLON" - which you
would expect.

I have tried escaping with " \' " but this returns the same
QUERY_SYNTAX_ERROR - has anyone else got a way of structuring the query, or
escaping the ' character that works??

Martin Allen

*>>Call me now for free<< <https://emailrtc.voiceflex.com/?c=7b355216c4>*


*01392 248692 - Main Office01392 690659 - Direct Line*

*[image: signature2]*

Have you visited our website recently? http://www.clystnet.com


The information in this email is confidential If you are not the intended
recipient, you must not read or use that information. This email and any
attachments are believed to be virus free however no responsibility is
accepted by Clystnet for any loss or damage arising in any way from receipt
or use thereof. Clystnet Ltd (company reg number 7164503) is based at
Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20190409/3f4679ff/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 10550 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20190409/3f4679ff/attachment.png>


More information about the vtigercrm-developers mailing list