私は画像、ユーザー名、そして重要なことに、クエリに伴う返信を表示しようとしています。以下のような同様のコードを使用しましたが、返信列では、情報がいっぱいであってもnullまたは空になり続けます。ヘッダー、画像、返信用の 3 つのテーブルがあります。ヘッダーには、ユーザーのユーザー名やその他の情報、画像、画像、返信の返信が含まれます。
reply.mid は images.mid と一致すると想定されているため、返信は画像の隣に配置できます。
SELECT images.id, images.who, header.username, images.message, images.name, reply.reply
FROM header, images
LEFT JOIN reply ON reply.reply = reply.mid
OR reply.mid = images.mid
WHERE images.name IS NOT NULL = header.id
AND images.who IS NOT NULL
AND images.message IS NOT NULL
GROUP BY images.mid
以下の物語の構造。ごめん
TABLE Header
username
id
who
where
Table images
message
name
mid - id that auto increments when image is loaded
id
content
Table reply
mid id that is taken from images mid to relate image to reply.
reply
id ----this is only for an id for a reply that is auto increment
アップデート。上記のコードは機能します。