samedi 1 août 2015

Xml shoutcast to a mysql database

i have made a php file to retrieve data to a database from a xml file and it works:

$title = $xml->SONGTITLE; {


// performing sql query

$sql = "INSERT INTO test_xml (`title`) VALUES ('$title') ON DUPLICATE KEY UPDATE time = now()";

the xml is from a shoutcast server, witch is made automatically from my radio. The xml line is:

<SONGTITLE>Morrissey - Don`t Make Fun of Daddy`s Voice (John Peel session)</SONGTITLE>

is there a way to separate the artist from the Song name? And retrieve title to title and artist to artist. Can you give me ideas how to start?

Aucun commentaire:

Enregistrer un commentaire