Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7170711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:16:03+00:00 2026-05-28T15:16:03+00:00

Hi i am making a arcade site, and it would be nice if you

  • 0

Hi i am making a arcade site, and it would be nice if you could use a gamefeed.

ived tryed all day to get data from xml files and add it to my mysql db, but i cant get it working.

This is the xml file i want to get info from:

http://www.freegamesforyourwebsite.com/feeds.php?feed=latest-games&format=rss

and the i want to put it into my db

can you please help me :-)?

i tryed this:

<?php
$feedUrl = 'http://playtomic.com/games/feed/playtomic?format=xml';
$ret = array();

// retrieve search results 
if($xml = simplexml_load_file($feedUrl)) {          
    $result["item"] = $xml->xpath("/rss/channel/item"); 

    foreach($result as $key => $attribute) { 
        $i=0; 
        foreach($attribute as $element) { 
             $ret[$i]['title'] = (string)$element->title; 
             $ret[$i]['swf'] = (string)$element->SWF; 
             $i++; 
        } 
    } 
}  

echo "<pre>";
print_r($ret); 
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:16:04+00:00Added an answer on May 28, 2026 at 3:16 pm

    from http://www.softarea51.com/tutorials/parse_rss_with_php.html

    you can always fetch the rss to an php array and do anything you want e.g. save it into a mysql db:

    <?php
    
    $doc = new DOMDocument();
    $doc->load('http://www.freegamesforyourwebsite.com/feeds.php?feed=latest-games&format=rss');
    $arrFeeds = array();
    foreach ($doc->getElementsByTagName('entry') as $node) {
        $itemRSS = array ( 
      'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
      'desc' => $node->getElementsByTagName('summary')->item(0)->nodeValue,
      'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
      'date' => $node->getElementsByTagName('published')->item(0)->nodeValue
      );
      array_push($arrFeeds, $itemRSS);
    }
    
    
    $mysqli = new mysqli('localhost', 'my_user', 'my_password', 'world');
    
    /* check connection */
    if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
    }
    
    $stmt = $mysqli->prepare("INSERT INTO `rssitems` (`title`, `summary`, `link`, `published`) VALUES (?, ?, ?, ?)");
    $stmt->bind_param('ssss', $title, $summary, $link, $published);
    
    foreach( $arrFeeds as $RssItem){
        $title = $RssItem["title"];
        $summary = $RssItem["summary"];
        $link = $RssItem["link"];
        $published = $RssItem["published"];
    
        $stmt->execute();
    }
    
    $stmt->close();
    $mysqli->close();
    
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Making the transition from Vim to gVim, I would like to disable all toolbars
Making an adobe flex ui in which data that is calculated must use proprietary
Im making firefox extension. One function stores value in every tab, to use it
Making a mobile friendly site, I have a single field and a submit button.
making a new jsp and got a mock-up from some analyst. Notice the sections
I would like to have a go at making some simple games for personal/learning
making a multi-language site with codeginiter. I have created two folders. One for french
Making a ternary logic table, and I would like to make my own function
Making an uno game for a project. all 108 cards are located in a
I'm making my first Android game which is going to be a 3D arcade-ish

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.