Code: Select all
$result = mysql_query ("SELECT * FROM chat WHERE status = 'closed' AND website = '$cookiewebsite' AND user != 'Operator' GROUP BY session ORDER BY id DESC");So you may have a load of rows with one Session ID, and many of those have 'Operator' as a user to has entered into that row.
But I want to find a chunk where they are all the same Session ID, but NO user entries for that Session ID say 'Operator'.
My script above should do it, but it's finding those where the user is 'user' but not Operator, even tho there are rows with the same Session ID that DO have Operator, and so it produces results that I don't want.
I need it to find chunks of Session ID, that do NOT have "operator" as a user entry.