$query1= mysql_query("select r.nid from ....");     
$query2= mysql_query("select t.nid from...."); 
Both these queries return a nid. How to compare the 2 returned nid are equal.. I'm just a beginner.
$query1= mysql_query("select r.nid from ....");     
$query2= mysql_query("select t.nid from...."); 
Both these queries return a nid. How to compare the 2 returned nid are equal.. I'm just a beginner.
 
    
    $row1 = mysql_fetch_row($query1);
$row2 = mysql_fetch_row($query2);
if($row1[0] == $row2[0])
{
//something
}
 
    
    You could do it in pure sql. Like this:
select 
    r.nid 
from 
    ....
WHERE EXISTS
(
    select 
        NULL 
    from
        ....
    WHERE
        t.nid = r.nid 
)
 
    
    If you are certainly sure that the query really returns one id, you can speed up checking it by:
$query1 = mysql_query("select r.nid from ...."); 
$query2 = mysql_query("select t.nid from ...."); 
if(mysql_fetch_field($query1, 0) === mysql_fetch_field($query2, 0))
{
    //do something
}
