сделать это так, без лишних косых черт
root="/home"
os.path.join(root,"build","test","sandboxes",todaystr,"new_sandbox")
Попробуйте изменить последний SQL-запрос на:
$get_grandtotal = mysqli_query($conn, "
SELECT SUM(L_PRICE) grand_total
FROM listings
WHERE v_ref = '$sellers[$i]' AND L_REF = '$product_ref'
");
Установите $grand_total = 0;
прямо там, где открыт цикл for
:
for ($i=0; $i < count($sellers); $i++) {
$grand_total = 0;
$get_products = ....
...
И прочитайте мой комментарий выше. [116 ]