Bonjour,
Est ce que qq1 peut m expliquer ce qui ne va pas dans ce code!!!! je n arrive pas a updater dans la BD
if ($total_stock <0){
$contenu = tep_db_query("select products_quantity as qte, prix_unit_moy as pm, orders_products_id as opid, products_id from " . TABLE_ORDERS_PRODUCTS . " where products_id = '" . (int)$products_id . "' and prix_unit_moy is null order by products_quantity asc");
$prunit = $HTTP_POST_VARS['prix_unit'];
while ($ctn = tep_db_fetch_array($contenu)) {
$this->ctn[] = array('qte' => $totals['qte'],
'opid' => $totals['opid']);
}
for($k=0;$k<sizeof($ctn);$k++)
{ if ($ctn['qte'][$k] <$qte_ajou )
{
tep_db_query("update " . TABLE_ORDERS_PRODUCTS . " set prix_unit_moy = '" . (int)$prunit . "' where orders_products_id = '" . (int)$ctn['opid'][$k] . "' ");
$qte_ajou = $qte_ajou - $var;
}
}
}
Les tep_db ... sont des foction mysql comme mysql_fetch_array et mysql_query
Si qq un peux m expliquer il me sauverai la vie!!!
Merci d avance
PBREAKER