I have this sql statement which does what I need it to do by selecting certain records basied on topic_id.
"SELECT e_files.name FROM e_topic
LEFT JOIN e_file_rel USING (topic_id)
LEFT JOIN e_files USING (file_id)
WHERE e_topic.topic_id = $_POST[topic_id]"
However, I need to also reverse it and get all the results that this above query does not get.
I have tried
"SELECT e_files.name,e_files.file_id FROM e_topic
LEFT JOIN e_file_rel ON (e_topic.topic_id <> e_file_rel.topic_id)
LEFT JOIN e_files USING (file_id)
WHERE e_topic.topic_id = $_POST[topic_id]";
"SELECT e_files.name,e_files.file_id FROM e_topic
LEFT JOIN e_file_rel ON (topic_id)
LEFT JOIN e_files USING (e_files.file_id <> e_file_rel.file_id)
WHERE e_topic.topic_id = $_POST[topic_id]";
"SELECT e_files.name,e_files.file_id FROM e_topic
LEFT JOIN e_file_rel ON (topic_id)
LEFT JOIN e_files USING (file_id)
WHERE e_topic.topic_id <> $_POST[topic_id]";
and do not get the results I need. If you have any ideas on what to try please let me know, thank you.