I have a field called field_url
which is of type link
. I want to query and fetch all those nodes which have field_url
value like eg. www.google.com
. I tried using the below code:
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'websites')
->fieldCondition('field_url','value','%google%','like');
$result = $query->execute();
I get database error with this. I saw the values stored in field_data_field_url
table and they look like serialized. What is the correct way of doing this?
LIKE/REGEXP
expression that reliably matches what you're looking for, or load all row in PHP and extract the relevant rows after deserialising the data – Clive♦ Aug 14 at 10:08