Tracking employee data We have hundreds of employees and for tracking each employees' data, and I am using this code:

&lt;?php
$sqldelivery9 = "SELECT COUNT(*) as count FROM orders WHERE employeename = 'nawaz' AND DATE(reattemptdate) = DATE(NOW() - INTERVAL 2 DAY)";
$resultdeliverys9 = $db_handle-&gt;runSelectQuery($sqldelivery9); 
$numrowsresultdelivery9 =$resultdeliverys9[0]['count'];         
echo $numrowsresultdelivery9;


Also, I am tracking the last 7 days of records of each employee, so it's going to be 100*7= 700 SQL queries. Is this acceptable? Will it going to affect performance? Is there any better way to do it with minimal SQL queries?
Definitely not. You can do that all in a single query.

SELECT employeename, DATE(reattemptdate) as date, COUNT(*) as count
    FROM orders
    WHERE employeename in ('name1', 'name2', 'name3', '...')
        AND DATE(reattemptdate) &gt; DATE(NOW() - INTERVAL 7 DAY)
    GROUP BY employeename, date


This will give you data in the form of

name1 | 2018-09-05 | 5
name1 | 2018-09-06 | 7
name1 | 2018-09-07 | 12
name1 | 2018-09-08 | 9
name1 | 2018-09-09 | 22
name2 | 2018-09-05 | 3
name2 | 2018-09-06 | 5
name2 | 2018-09-07 | 9
name2 | 2018-09-08 | 11
name2 | 2018-09-09 | 16
...


All you need is to iterate over the data.

Of course you can drop the employeename in ('name1', 'name2', 'name3', '...') condition if you want to search over ALL employees and not just "specific n" ones.