<?xml version="1.0" ?>
<aws:UrlInfoResponse xmlns:aws="http://alexa.amazonaws.com/doc/2005-10-05/">
<aws:Response xmlns:aws="http://awis.amazonaws.com/doc/2005-07-11">
<aws:OperationRequest>
</aws:OperationRequest>
<aws:UrlInfoResult>
<aws:Alexa>
<aws:TrafficData>
<aws:DataUrl type="canonical">google.com/</aws:DataUrl>
<aws:Rank>1</aws:Rank>
</aws:TrafficData>
</aws:Alexa>
</aws:UrlInfoResult>
<aws:ResponseStatus xmlns:aws="http://alexa.amazonaws.com/doc/2005-10-05/">
<aws:StatusCode>Success</aws:StatusCode>
</aws:ResponseStatus>
</aws:Response>
</aws:UrlInfoResponse>
Run Code Online (Sandbox Code Playgroud)
我要解析的是这个xml文档的排名.在尝试的同时,我正在做的是......
$xml= simplexml_load_file("path of the file saved");
echo $xml->Response->UrlInfoResult->Alexa->TrafficData->Rank;
Run Code Online (Sandbox Code Playgroud)
但我这样做是错误的.比如说
Notice: Trying to get property of non-object in C:\wamp\www\SEO Stats[Only Testing]\Tools\web_worth.php on line 13
Run Code Online (Sandbox Code Playgroud)
错误就在这一行
echo $xml->Response->UrlInfoResult->Alexa->TrafficData->Rank;
this line is referred as line no 13..
Run Code Online (Sandbox Code Playgroud) 我搜索了这个问题,发现了很多类似的答案
这就是公认的答案
$ this-> Widget-> updateAll(
Run Code Online (Sandbox Code Playgroud)array('Widget.numberfield' => 'Widget.numberfield + 1'), array('Widget.id' => 1));
现在,iam在cakephp3中使用此查询。这是我的样子
$ Questions = $ this-> loadModel('Questions');
$问题-> updateAll(
Run Code Online (Sandbox Code Playgroud)array('questions.trend' => 'questions.trend + 1'), array('questions.description' => $undashed_title));
一切正常,查询正在执行,但是当我检查调试器的sql日志时,这就是我发现的内容
更新问题,请设置questions.trend ='questions.trend + 1',而where Problems.description ='哪种类型
但是我在数据库中的值没有像应有的那样更新(我说这是因为我也已经在phpmyadmin控制台上复制了此查询,并且无法正常工作)
我相信查询应该看起来像这样
更新问题SETquestions.trend = questions.trend + 1 WHEREquestions.description ='What Type'
任何帮助,将不胜感激,谢谢:)