Klez Posted February 14, 2005 Report Share Posted February 14, 2005 vai no tabulas ir iespeejams ar vienu query izdzeest vairaakus ierakstus peec ID DB = mysql 4.0.23 ID tabulaa ir int autoIncrement id | val 1 a 2 b 3 dd 4 ff gribu izdzeest 1 un 3 ierakstu ar vienu query. bet zinaams ir tikai ieraksta ID ir tas paveicams? Link to comment Share on other sites More sharing options...
Venom Posted February 14, 2005 Report Share Posted February 14, 2005 DELETE FROM tabula WHERE id IN(1,3) NB: ja ģenerē att. checkbox-inpututus while (...fetch...) <input type="checkbox" name="todelete[]" value=" $id " /> tad var ērti izmantot 'DELETE FROM tabula WHERE id IN('. implode(',', $_POST['todelete']).')' variantu Link to comment Share on other sites More sharing options...
Klez Posted February 14, 2005 Author Report Share Posted February 14, 2005 'DELETE FROM tabula WHERE id IN('. implode(',', $_POST['todelete']).')' 13695[/snapback] shis baigi laps varinats. To arii vajadzeeja. paldies :) Link to comment Share on other sites More sharing options...
bubu Posted February 14, 2005 Report Share Posted February 14, 2005 (edited) Klez, tik atceries: neuzticies lietotāja datiem!!! Pirms laid to implode uz $_POST masīva elementu, izej viņam cauri un pārliecinies, ka visas vērtības ir integer! DELETE FROM tabula WHERE id IN('. implode(',', array_map("intval", $_POST['todelete'])).')' Edited February 14, 2005 by bubu Link to comment Share on other sites More sharing options...
Recommended Posts