最初のクエリを使用して、次のようにユーザーのIDと名前を取得します。
select id,name from temp_card where sex='$sex' and city='$city' order by name ASC
次に、最初のクエリの結果を使用し、別のテーブルからより多くのデータを取得する2番目のクエリがあります。
select images from temp_card_images where temp_card_id=". $row['id'] ." order by id ASC limit 1
これらの2つのクエリを組み合わせて、3つのフィールド(id、name、images)を1つのwhileループで出力するにはどうすればよいですか?
ありがとうございました!