我需要从我的数据库中检查xml feeder更新日期和更新日期,并获取我的数据库中不存在的更新日期。 我这样做是因为我需要从上次解析器启动时获得几率变化。
但是有问题,它一直没有发生,只是整天加载页面。
这是代码:
$updDate = $this->PDO->prepare("select distinct FixtureMatch_Id,UpdatedDate from odds");
$updDate->execute();
$updDate->setFetchMode(PDO::FETCH_ASSOC);
while($row = $updDate->fetch()){
$odds=$this->soccer->GetAllOddsByFixtureMatchId(
array("fixtureMatch_Id"=>$row['FixtureMatch_Id']))
->xpath("//Odds[not(contains(UpdatedDate,$row['UpdatedDate']))]");
echo $row['FixtureMatch_Id'] . ' : ' . $row['UpdatedDate'] . '<br>';
}
}
这是我在没有xpath的情况下转储时的样子:
$odds=$this->soccer->GetAllOddsByFixtureMatchId(
array("fixtureMatch_Id"=>$row['FixtureMatch_Id']))->OddsList->Odds;
XML
object(SimpleXMLElement)[11]
public 'FixtureMatch_Id' => string '325006' (length=6)
public 'Bookmaker' => string 'Pinnacle' (length=8)
public 'UpdatedDate' => string '2015-05-23T14:58:51.213' (length=23)
public 'Type' => string 'Over/Under 2.5' (length=14)
public 'HomeOdds' => string '1.85' (length=4)
public 'AwayOdds' => string '2.08' (length=4)
更新:在数据库中,赔率表中有16000行,这有问题吗?