OK Edit here にはまだ問題がありますが、コードを更新する前と同じではありません
<?php
date_default_timezone_set('Europe/London');
$date = date('Y-m-d H:i:s', time());
$now = date('Y-m-d H:i:s');
$dbhost = "localhost";
$dbuser = "admin_cdm_clap";
$dbpass = "zdqUyFc5bAG1e6TWrIhijH3j7gB8xhmHI4q";
$db = "iTunesConnect";
$driveID = 562220229;
$connect = mysql_connect($dbhost,$dbuser,$dbpass) or die (mysql_error());
mysql_select_db($db);
$query = "SELECT `code` from `countries`";
$result = mysql_query($query) or die (mysql_error());
$num=mysql_num_rows($result);
$i=0;
while ($i < $num) {
$country=mysql_result($result,$i,"code");
$completeUrl = "https://itunes.apple.com/".strtolower($country)."/rss/toppaidapplications/limit=300/genre=6002/xml";
//echo $completeUrl.'<br>';
$xml = simplexml_load_file($completeUrl);
$entries = $xml->entry;
for ($a = 0; $a < 300; $a++) {
//$updated = $entries[$a]->updated;
$id = $entries[$a]->id->attributes('im', true)->id;
$bundle = $entries[$a]->id->attributes('im', true)->bundleId;
$cc = $entries[$a]->id;
$title = $entries[$a]->title;
$category = $entries[$a]->category['term'];
$nUpdated = microtime(true); //strtotime(substr($updated,0,10).' '.substr($updated, 11, 8))
$storeCode = substr($cc, 25, 2);
$storeCat = 6002;
if($id == $driveID){
$rankRec = "INSERT INTO rankings (id, rank, updated, store, category) VALUES (NULL, $a, $nUpdated, '$storeCode','$storeCat')";
mysql_query($rankRec) or die(mysql_error());
} else {
error_reporting(E_ALL);
ini_set('display_errors', '1');
}
}
$i++;
}
?>
次のエラーが発生しました。
Notice: 行 24 で /var/www/vhosts/createdm.com/httpdocs/iTunesConnect/iTunesRanking.php の非オブジェクトのプロパティを取得しようとしています 致命的なエラー: / の非オブジェクトでメンバ関数 attributes() を呼び出します24 行目の var/www/vhosts/createdm.com/httpdocs/iTunesConnect/iTunesRanking.php