作者dream1x (翻桌客 )
看板PHP
標題[請益] 多筆資料刪除
時間Wed Aug 12 23:49:04 2009
有好幾個資料表都有同樣欄位需要刪除
功能我這樣土法煉鋼是可以達到的
但是效率的問題
是否有一氣呵成的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
推 alpe :mysql 版本是? 08/13 10:48
→ dream1x :5.0.51b哦 08/13 11:08