mira he hecho como tu decias
Código PHP:
<?php
include("invoice_mail.php");
session_start();
//$srt_sql ="delete from cart where IDCOOKIE = '" . GetCartId() . "'";
//mysql_query($srt_sql) or die("Error en el query $str_sql... Mysql dice: ".mysql_error());
$sql = mysql_query("select max(idorder) from orders where IDKLANT='".$_SESSION['login_session']['idklant']."'");
$row = mysql_fetch_row($sql);
$idorder =$row[0];
$status ="OK";
mysql_query("update orders set STATUS = '$status' where IDORDER = '$idorder'");
$sql = mysql_query ("select * from cart inner join products on cart.IDPRODUCT = products.IDPRODUCT where cart.IDCOOKIE = '" . GetCartId() . "");
while ($row = mysql_fetch_row($sql)){
$idproduct = $row["IDPRODUCT"];
$newstock = $row["STOCK"] - $row["QTY"];
mysql_query ("UPDATE products SET STOCK = '$newstock' WHERE IDPRODUCT = '$idproduct'");
}
?>
pero me da este error
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/linse-webshop.nl/httpdocs/succes.php on line 15