Oh, ya... now that I bothered to actually read your post, instead of just looking at bad syntax...
No.. not really.
Kind of saying be both true and false at the same time, and logical programmatic constructs don't like being irrational.
What you'd do here is code for it.
<?
$stmt = "SELECT tid,pid FROM table";
... do your query...
for($i=0;$count($mysql_num_rows($result);$i++) {
$myData[$i] = mysql_fetch_array($result,'MYSQL_ASSOC');
}
$tid = array();
$pid = array();
foreach ($myData as $key=>$val) {
foreach($myData[$key] as $nKey=>$nVal) {
if ($nKey=='tid') {
array_push($tid,$nVal);
} else {
array_push($pid,$nVal);
}
}
}
//now do the math...
for ($i=0;$i<count($tid);$i++) {
if ($pid[$i] != $tid[$i]) {
$no_equal++;
} else {
$is_equal++;
}
}
echo $no_equal . "<BR>";
echo $is_equal . "<BR>";
echo "From a total of: " . count($tid) . " rows.";
?>