0

I have a problem in my php code. does anyone know how to fix this? Help me please! Warning: A non-numeric value encountered in C:\xampp\htdocs\stock\dashboard.php on line 15

Code:

$totalRevenue = "";
while ($orderResult = $orderQuery->fetch_assoc()) {
    $totalRevenue += $orderResult['paid'];
}
Andrei Lupuleasa
  • 2,677
  • 3
  • 14
  • 32

1 Answers1

0

you need to initialize $totalRevenue to 0, not an empty string

jtylerm
  • 482
  • 4
  • 15