[snip] $deferred_comments= "SELECT * FROM comments WHERE credit_card_id = '$credit_card_id' AND request_type = 'D'"; $result_deferred_comments = mssql_query($deferred_comments) or die(mssql_error()); if(!empty($result_deferred_comments)) { [/snip] $result_deferred_comments is not empty, a query resource was returned. To see this; echo $result_deferred_comments; What you want to do is something like this; $num_Deferred_Comments = mysql_num_rows($result_deferred_comments); if(0 != $num_Deferred_Comments)) {.... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php