XMLRPC의 내 기능이 다음과 같이 작동하는지 확인하십시오. 최신 내용 인 경우 내 웹 사이트에 내용이 이미 있는지 확인하고 필요한 경우 업데이트하십시오. 나는 그것을 확인하기 위해 숫자 (두 가지 콘텐츠 유형 모두 같은 수를 가질 수 있음)를 확인합니다. 해시 (고유)와 유형입니다.Select with select where where where 절
콘텐츠가 하나 뿐이고 기능이 정상적으로 작동하기 전에 번호와 해시 대신 콘텐츠 유형을 확인해야합니다. 그게 문제입니다. 제가 해보려한다면, 저는 빈 anwser를 얻었습니다. 내 기능은 다음과 같습니다.
$query = db_query("SELECT (table_num.field_num) FROM (table_num, table_type) WHERE table_num.entity = table_type.entity AND table_num.field_num = :num AND table_type.field_type = :type", array(':num' => $num, ':type' =>$type));
foreach ($query as $record) {
if($record->rowCount()==0) return 0;
else {
$query = db_query("SELECT (table_hash.field_hash) FROM (table_hash, table_type) WHERE table_hash.entity = table_type.entity AND table_hash.field_hash = :hash AND table_type.field_type = :type", array(':hash' => $hash, ':type' =>$type));
foreach ($query as $record) {
if($record->rowCount()==1) return 1;
else{
$query = db_query("SELECT (table_num.entity_id) FROM (table_num, table_type) WHERE table_num.entity = table_type.entity AND table_num.field_num = :num AND table_type.field_type = :type", array(':num' => $num, ':type' =>$type));
foreach ($query as $record) {
echo $record->field_entity_id;
}
return $record;
P.S. 0을 반환하면 내 DB에 존재하지 않으며, 1은 업데이트해야 할 때 최신이고 엔터티 일 때입니다.
죄송합니다. 긴 SQL 용으로 사용하기 시작했지만 사용하기 시작했습니다. 누군가 내가 빈 anwser를 얻는 이유를 알고 있습니까?
감사합니다, 곧 내 질문을 업데이 트됩니다. 나는 그것이 지금 당장 이해하기 어렵다는 것을 압니다. – RTD