我有一个mysql查询
$raw_resultsplaylists = mysql_query("SELECT songs.*, playlists.title as `playlist_title`
FROM song_main AS songs
JOIN songs_in_list AS playlist_songs
ON songs.ID = playlist_songs.song_id
JOIN playlists
ON playlist_songs.playlist_id = playlists.ID
WHERE playlists.owner_id = '$userid'") or die(mysql_error());
检索如下信息数组:
playlist_title song_name song_url song_artist
-------------------------------------------------------------------
foo1 woops www. -
foo1 blah www. -
foo2 blop www. -
foo1 woop www. -
foo3 bob www. -
foo1 dylan www. -
我的问题是如何对 Mysql 数组进行切片以playlist_title
在单独的数组中获取所有相同的行,以便我可以将它们显示在单独的 html 表中,例如:
html表1:
playlist_title song_name song_url song_artist
-------------------------------------------------------------------
foo1 woops www. -
foo1 blah www. -
foo1 woop www. -
foo1 dylan www. -
html表2
playlist_title song_name song_url song_artist
-------------------------------------------------------------------
foo2 blop www. -
foo2 dylan www. -
ETC...