[請益] 多筆資料刪除

看板PHP作者 (翻桌客 )時間16年前 (2009/08/12 23:49), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/4 (看更多)
有好幾個資料表都有同樣欄位需要刪除 功能我這樣土法煉鋼是可以達到的 但是效率的問題 是否有一氣呵成的sql下法呢 一次把所有表格的 tourid = 10都給刪掉(型態長度皆同等) 目前程式碼 mysql_query("delete from tra where tourId = 10", $link)or die(mysql_error()); mysql_query("delete from bad where tourId = 10", $link)or die(mysql_error()); mysql_query("delete from gue where tourId = 10", $link)or die(mysql_error()); mysql_query("delete from rec where tourId = 10", $link)or die(mysql_error()); mysql_query("delete from alb where tourId = 10", $link)or die(mysql_error()); 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.47.206.58

08/13 10:48, , 1F
mysql 版本是?
08/13 10:48, 1F

08/13 11:08, , 2F
5.0.51b哦
08/13 11:08, 2F
文章代碼(AID): #1AWkHtWk (PHP)
討論串 (同標題文章)
文章代碼(AID): #1AWkHtWk (PHP)