データベース構造:
id galleryId type file_name description
1 `artists_2010-01-15_7c1ec` `image` `band602.jpg` `Red Umbrella Promo`
2 `artists_2010-01-15_7c1ec` `image` `nov7.jpg` `CD Release Party`
3 `artists_2010-01-15_7c1ec` `video` `band.flv` `Presskit`
アプリケーションの 1 つのセクションの画像、別のセクションのビデオなどを抽出します。次のように、セクションごとに複数の mysql クエリを作成する方がよいでしょうか。
$query = mysql_query("SELECT * FROM galleries WHERE galleryId='$galleryId' && type='image');
...または、連想配列を作成し、結果セットを使用する必要があるときはいつでも配列を何度もループする必要がありますか?
考えてくれてありがとう。