How to Count number of rows in a table that matches to the related condition and echo that count out.

Code goes as follows::
Code:
    <?php 
         $sql = "SELECT * FROM input ORDER BY date DESC";
		 $result = $conn->query($sql);
								
		 if ($result->num_rows > 0) { 
         while($row = $result->fetch_assoc()) { 
         $myid = $row["id"]
...