2012-05-04 1 views

答えて

0

$url = "http://www.boardgamegeek.com/xmlapi2/collection?username=wizball&own=1"; 

$xml = simplexml_load_file($url); 
$i = 0; 
    foreach($xml->item as $item) 
    { 
      echo '<div>' . $item->name . '</div>'; 
      $id=$xml->item[$i]->objectid->attributes(); 
      $i++ 

$insert_bgg = sprintf("INSERT INTO trans (objectid, name, yearpublished, image, privatecomment) VALUES ('".$id."','".$item->name."','".$item->yearpublished."','".$item->image."','".$item->privateinfo->privatecomment."')"); 

echo $insert_bgg; 

多くのおかげで、私はあなたがページからデータを取得し、それを分割しようとしていると思いますか?そして、あなたは単純なXMLを使用して、配列にそれを渡すことができhttp://www.howtogeek.com/howto/programming/php-get-the-contents-of-a-web-page-rss-feed-or-xml-file-into-a-string-variable/

:まずデータを取得していないURLをリンク

は、見てみましょう。

さらに詳しい情報が必要な場合はお知らせください。

+0

多くのおかげで、私は次の朝起きたときにそれを解決することができました。私は$ item ['objectid']を使用してエンディングしました。 – PeterW

関連する問題