i want to count row and print php echo. But when i echo the query it show: Resource id #5. But it must show only number 5.

```
<?php 
$db=require "script_database/connect.php"; 
$query="select count(name) from selection where salary>2000 and job='teacher' ";
        $key=mysql_query($query);
        echo $key;
         if(key>0)
        {

        echo "no row found";

        }
 ?>

```