scarhand Posted April 2, 2009 Share Posted April 2, 2009 mysql_query("delete from shoutbox where id not in (select id from shoutbox order by id desc limit 10);") why is this not working? Quote Link to comment https://forums.phpfreaks.com/topic/152205-delete-all-but-top-10-rows-not-working/ Share on other sites More sharing options...
fenway Posted April 2, 2009 Share Posted April 2, 2009 Define "not working" -- maybe it's a self-table thing. Quote Link to comment https://forums.phpfreaks.com/topic/152205-delete-all-but-top-10-rows-not-working/#findComment-799344 Share on other sites More sharing options...
scarhand Posted April 2, 2009 Author Share Posted April 2, 2009 its not deleting anything. Quote Link to comment https://forums.phpfreaks.com/topic/152205-delete-all-but-top-10-rows-not-working/#findComment-799347 Share on other sites More sharing options...
fenway Posted April 2, 2009 Share Posted April 2, 2009 Hmm... what about a left join to itself? Quote Link to comment https://forums.phpfreaks.com/topic/152205-delete-all-but-top-10-rows-not-working/#findComment-799636 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.