I am getting the following error message when executing my query:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax near '://www.website.com.br/Manual_01/Realm/1980-1988/R7678.htm' na linha 1: SELECT (field_data_field_url.entity_id) FROM field_data_field_url WHERE field_data_field_url.field_url_value = http//www.website.com.br/Manual_01/Realm/1980-1988/R7678.htm ; Array ( ) em _xmlrpc_troca()
this is my function from my Drupal Module:
$query = db_query("SELECT (field_data_field_url.entity_id) FROM field_data_field_url WHERE field_data_field_url.field_url_value = $url ");
foreach ($query as $record) {
echo $record->entity_id;
}
return $record;
If I wrap my '$url' with ' ' it works:
$query = db_query("SELECT (field_data_field_url.entity_id) FROM field_data_field_url WHERE field_data_field_url.field_url_value = '$url' ");
but i get error at xmlrpc response because it sends back the '' and i get error while parsing the response. this response comes with the right data but it´s useless because I can´t parse it. Someone knows how to fix it?
EDIT:
the response comes like this:
body: '30254<?xml version="1.0"?>\n\n<methodResponse>\n <params>\n <param>\n <value><struct>\n <member><name>entity_id</name><value><string>30254</string></value></member>\n</struct></value>\n </param>\n </params>\n</methodResponse>\n\n'
This '30254 and the ' at the end are the problems. I got this error message:
ExpatError: not well-formed (invalid token): line 1, column 5