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? 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. 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. 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? 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
Archived
This topic is now archived and is closed to further replies.