hello,
i'm doing this website where the users can posts news and upload images. i thought that it would be best to put all images in one table and all "content" in another. table images has the primary key of table content. i want to be able to find out which posts do not have any images associated with them.
these are my tables
table content
contentID
txtTitle
txtAuthor
txtBlog
table images
imageID
contentID
txtPath
this is the query i'm working with:
SELECT content.contentID, content.txtTitle, content.txtAuthor
FROM content, image
WHERE content.contentID != image.contentID
ORDER BY content.contentID DESC
the problem with this is that it shows every record twice (actually, it now went up to three times).
i got that query because:
SELECT content.contentID, content.txtTitle, content.txtAuthor
FROM content, image
WHERE content.contentID = image.contentID
ORDER BY content.contentID DESC
gives me all the records that have an image associated with them, i figured that by adding a ! it would work, and it did, and then i did something and it stopped working. i didn't really do anything to affect this code, all i did was add more records and then it got screwed up. i've tried using NOT and ISNULL, IS NULL, IS NOT NULL and i'm about to give up.
so please, help me!