I am trying to compare two table, in one table(location) I have only one instance of a UserId with it's appropriate info and in the OTHER table(UserLocations) I have allowed more than one instance of a UserId with it's respective info.
I want to find which UserId's have MORE THAN ONE entry in the table UserLocations and a matching UserId set in the table location.
I have tried variations of the following:
$sql = "SELECT UL.UserId, COUNT(UL.UserId) as inul FROM UserLocations UL, location L WHERE UL.UserId = L.UserID";
with absolutely NO LUCK. Any ideas?
And yes, the two table have the UserId field labelled differently as shown above.
Thanks!