Query to Find Not Matching Columns in Two Tables

Ok,

here is what I have


$getmismatch = mysql_query("SELECT films.film_id,films.film_title,films.aus
 FROM films,film_matching 
WHERE films.film_id=film_matching.film_id 
AND 
films.aus!=film_matching.aus",$connect);

I have two tables.

I want only the rows with matching “film_id” columns that don’t also have matching “aus” columns.

What am I doing wrong here?

Thanks
Ryan

that query looks exactly right for what you said you wanted

:slight_smile:

That’s what I thought, but I’m getting:

mysql_query() expects parameter 2 to be resource, null given

Cheers
Ryan

sonds to me like you have a php problem :slight_smile:

Ah, you are right. I forgot to include my connection script.

But I am getting zero rows showing up, and I’ve tried changing a variable in the “aus” column of one table to ensure that it is different from matching column in other table for the same “film_id”.

So I’ll have

Table “films”
film_id = 3200
aus = R

Table “film_matching”
film_id = 3200
aus = S

So I want that row to show up in my query, as the AUS is not the same for same film_id.

Possible?
Ryan

Cancel that!

I forgot to update other table with recent inserts.

(smack head)

It’s working

Ryan

glad i could help :smiley: