SQL:$SQL="delete from `doing` where id in ('1,2,3,4')"; 數據用逗號隔開。 表單:<form action="?action=doing" method="post"> <input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="1"/> <input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="2"/> <input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="3"/> <input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="4"/> <input type="submit"/> </form> 好$ID_Dele=$_POST['ID_Dele']將會是一個數組,雖然說PHP是弱類型的,但這裡可沒ASP弱。ASP可以直接: SQL="delete from [doing] where id in ('"&ID_Dele&"')"進行刪除。但PHP不能把$ID_Dele直接放進去。因為$ID_Dele可不是'1,2,3,4'哦,因為$ID_Dele是一個數組,具有鍵和值。 好,PHP中也不難,剛好有個函數:implode(),對了。同split()\explode()功能剛好相反的一個函數,後兩者是用某字符(比如逗號)分割的,而前者則可以拼接為字符串。 因此:$ID_Dele= implode(",",$_POST['ID_Dele']); $SQL="delete from `doing` where id in ($ID_Dele)";