執行我的查詢時,我收到以下錯誤消息:PDOException:SQLSTATE [42000]:語法錯誤或訪問衝突Mysql的
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()
這是從我的Drupal模塊我的功能:
$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;
如果我總結我的「$ URL」與'它的工作原理:
$query = db_query("SELECT (field_data_field_url.entity_id) FROM field_data_field_url WHERE field_data_field_url.field_url_value = '$url' ");
但我在XML-RPC響應得到錯誤,因爲它發回''和我解析響應時出錯。這個迴應帶有正確的數據,但它沒用,因爲我無法解析它。 有人知道如何解決它?
編輯:
響應就這樣產生了:
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'
這'30254
和'
末是問題。我得到了這個錯誤信息:
ExpatError: not well-formed (invalid token): line 1, column 5
什麼是在響應中發送的數據,它需要什麼? (爲什麼你不能解析它) – steven