Hello sir,
I am new learner of PHP-PDO-MYSql, getting a Warning: “A non-numeric value encountered in …test.php on line 35”
When database has numeric value and field structure is set to INT. When I echo, I get the numeric value! I am not able to detect the error I am doing! Please help. Here is the code containing line 35 [ $totalRevenue += $orderResult[‘paid’]; ]
$orderSql = "SELECT * FROM orders WHERE order_status = 1";
$orderQuery = $connect->query($orderSql);
$countOrder = $orderQuery->num_rows;
$totalRevenue = "";
$orderResult = "";
while ($orderResult = $orderQuery->fetch_assoc()) {
$totalRevenue += $orderResult['paid']; // this is the warning line
//$totalRevenue = $totalRevenue + $orderResult['paid'];
//echo $totalRevenue;
}
Thank you for your time spending for helping me.