Jump to content

Recommended Posts

what i'm doin is that I'm reading my filename.m3u and I try to add the info to a database... but it sais that all 86 tracks was added but it only adds 30....

 

<?php
foreach(file("test.m3u") as $key => $file)
{
	preg_match('/^#EXTINF:[[:digit:]]+,(.*)$/',$file,$matches);
	//preg_match('/^.*$/',$file,$matches); This matches the entire line
	if ($matches) {
		$info = explode("/", $matches[1]);
		if ($info[0] == "Hip") { 
			$info[0] = "Hip-Hop";
			$info[1] = $info[3];	
		}
		$info[1] = str_replace("'", "`", $info[1]);
		$info[2] = str_replace("'", "`", $info[2]);
		$query = "INSERT INTO `playlist` VALUES ('', '$info[1]', '$info[2]', '$info[0]', '')";
		$result = mysql_query($query);
		if (!$result) { die(mysql_error()); }
		echo "Track succsessfully added<br>";
		echo "Artist: $info[1]<br>";
		echo "Tittel: $info[2]<br>";
		echo "Sjanger: $info[0]<br><br>";
	}
}
?>

 

any ideas why this is happening?

 

Thanks In Advance

- Clown

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.