I solved the problem
[php]$html = “”;
$url = “http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topsongs/limit=25/xml”;
$xml = simplexml_load_file($url);
$delete = ‘DELETE FROM song’;
$connection->query($delete);
//echo $xml->entry[0]->title;
for($i = 0; $i < 25; $i++){
$namespace = $xml->entry->getNameSpaces(true);
$x = $xml->entry[$i]->children($namespace[‘im’]);
$title = $xml->entry[$i]->title;
$name =mysqli_real_escape_string($connection, $x->name);
$price =mysqli_real_escape_string($connection, $x->price);
$html .= "$name";
$html .= "<br>$title";
$html .= "<br />$price<hr />";
$Stitle= mysqli_real_escape_string($connection, $title);// to insert into DB
$quiry = 'INSERT INTO song (title)'; // col in database
$quiry .= "VALUES ('$Stitle')"; // variables that come from user which is decleare here
$result = mysqli_query($connection, $quiry);
if (!$result)
{ echo"1";
die(“Query Faile”. mysqli_errno($connection));
}
}
//echo $html;[/php]