clown[NOR] Posted May 11, 2007 Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/51007-solved-help-insert-into-wont-work-properly/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.