I would agree that the function num_rows is probably the best way to do it.
Without it, well you can do something like:
$foo = query( "select foo from bar" );
$output_string = '';
while( $row = fetch_array( $foo ) )
$output_string .= $row[ 'foo' ];
if( !$output_string )
echo "No output!";