Files
crm.e5.pl/modules/EcmInvoiceOutOlds/update_item_id.php
2024-04-27 09:23:34 +02:00

10 lines
623 B
PHP

<?
$w=$GLOBALS[db]->query("select * from ecminvoiceoutolds where id='8aa03944-fc72-26ec-8eb4-4b718085454e'");
while($r=$GLOBALS[db]->fetchByAssoc($w)){
$ww=$GLOBALS[db]->query("select * from ecminvoiceoutolditems where ecminvoiceoutold_id='".$r['id']."'");
while($rr=$GLOBALS[db]->fetchByAssoc($ww)){
$rrr=$GLOBALS[db]->fetchByAssoc($GLOBALS[db]->query("select id from ecminvoiceoutolditems where ecminvoiceoutold_id='".$r['ecminvoiceoutold_id']."' and ecmproduct_id='".$rr['ecmproduct_id']."'"));
echo "update ecminvoiceoutolditems set ecminvoiceoutolditem_id='".$rrr['id']."' where id='".$rr['id']."';<br>";
}
}
?>