Well, this has a syntax error...
if($row1["dbb"]==$row2["dbb"]{
...should be...
if($row1["dbb"]==$row2["dbb"]){
And I really don't like the idea of whiling within a while...
could you try...
<?
for($i=0;$i<mysql_num_rows($result1);$i++) {
$row1[$i] = mysql_fetch_array($result1, MYSQL_ASSOC);
}
for($i=0;$i<mysql_num_rows($result2);$i++) {
$row2[$i] = mysql_fetch_array($result2, MYSQL_ASSOC);
}
// we now have two hash tables
//lets loop and compare...
foreach ($row1 as $key=>$val) {
if ($row1[$key]['dbb'] == $row2[$key]['dbb']) {
echo $row2["dbb"];
}
}
?>