supanoob Posted October 19, 2007 Share Posted October 19, 2007 OK so i have an "Inventory System" and i need to delete say 100 rows of the same item belonging to the same person. How would this be possible? So for example it is set out like this: [tr] [td]Inventory ID Item Id Belongs to ID 1 12 1 1 12 1 but that data was like 157 times, how would i go about deleting 100 of those rows? Quote Link to comment https://forums.phpfreaks.com/topic/73936-solved-deleting-from-table/ Share on other sites More sharing options...
papaface Posted October 19, 2007 Share Posted October 19, 2007 DELETE FROM `TABLENAME`WHERE `Item Id` = '12' AND `Belongs to ID` = '1' should work. Quote Link to comment https://forums.phpfreaks.com/topic/73936-solved-deleting-from-table/#findComment-373076 Share on other sites More sharing options...
supanoob Posted October 19, 2007 Author Share Posted October 19, 2007 but how would i limit how many it deletes? i only want 100 of them gone not all of them if it is over 100. Quote Link to comment https://forums.phpfreaks.com/topic/73936-solved-deleting-from-table/#findComment-373079 Share on other sites More sharing options...
papaface Posted October 19, 2007 Share Posted October 19, 2007 try adding: LIMIT 0,100 to the end, it may work. Quote Link to comment https://forums.phpfreaks.com/topic/73936-solved-deleting-from-table/#findComment-373087 Share on other sites More sharing options...
supanoob Posted October 19, 2007 Author Share Posted October 19, 2007 ill give that a go thanks. Quote Link to comment https://forums.phpfreaks.com/topic/73936-solved-deleting-from-table/#findComment-373146 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.