0

I have a php page that is using an associative array:

$piececount = array(array());
        $data = '';
                while($calls = sqlsrv_fetch_array($objRs, SQLSRV_FETCH_ASSOC)) {
                    $data = '{#'.$calls["USR_ID"].'`'.date('mdY',strtotime($calls["DTE"])).'#}';
                    $piececount[$data]["count"] += $calls["SER_QTY"]; //This tallys up serial piece count per asset per day

This works, but for every iteration of the while loop PHP is logging the following errors:

PHP Notice:  Undefined index: {#41`01292019#} in C:\inetpub\wwwteam\Schedule\schedule.php on line 341
PHP Notice:  Undefined index: count in C:\inetpub\wwwteam\Schedule\schedule.php on line 341

I know this is due to the index not being initialized but for the life of me i cannot figure out how to fix this. Anyone have any ideas what I am missing?

A. Guattery
  • 113
  • 8

0 Answers0