I tried that an ended up getting unpredictable results.
I search around and came up with something like this
Code: Select all
$query = "SELECT jobs.CID, jobs.JID, users.CID
FROM jobs, users
WHERE jobs.JID = '$jid'
AND jobs.CID != users.CID";
$result = mysql_query($query, $connection) or die
("Error in query: $query. " . mysql_error());
while($test_cids = mysql_fetch_array($result)) {
echo "<li>".$test_cids['CID']."</li>";
}
The only problem is that for each duplicate job i am getting duplicate cids back.. only one cid can be assigned to each instance of a job number.. leaving me with more duplicates each time a job number is duplicated.
what about something like this?
Code: Select all
$query = "SELECT jobs.CID, jobs.JID, users.CID
FROM jobs, users
WHERE jobs.JID = '$jid'
AND jobs.CID != users.CID";
"AND the amount of times the CID occures is equal to the ammount of times the job number occurs."
I am thinking something along those lines would weed out duplicates. Anyone know how I could do this or a better way to go about it?