query("select * from ecmstockoperations where product_id='582' and stock_id='c7afd71a-4c3a-bde4-138d-4acaee1644e4' and in_id is null and used=0"); while($tmp=$db->fetchByAssoc($r)){ var_dump($tmp); } ?>