contra10 Posted March 4, 2009 Share Posted March 4, 2009 if i wanted to delete the first 10 entries in my db i.e. there are 20 latest entries and i want to delete the first 10 that were entered. how could i do that...does it invilve using the max function Link to comment https://forums.phpfreaks.com/topic/148005-solved-deleting-first-entries-in-db/ Share on other sites More sharing options...
sasa Posted March 4, 2009 Share Posted March 4, 2009 DELETE FROM table_name WHERE 1 ORDER BY fiel_name LIMIT10 Link to comment https://forums.phpfreaks.com/topic/148005-solved-deleting-first-entries-in-db/#findComment-776800 Share on other sites More sharing options...
Cosizzle Posted March 4, 2009 Share Posted March 4, 2009 DELETE FROM table_name LIMIT 10 edit: Use sasa method, bit more safe Link to comment https://forums.phpfreaks.com/topic/148005-solved-deleting-first-entries-in-db/#findComment-776801 Share on other sites More sharing options...
Technocracy Posted March 4, 2009 Share Posted March 4, 2009 <?php mysql_query(" DELETE FROM `table` ORDER BY `auto_incremental_key` ASC LIMIT 10 "); ?> Presumably that's what you mean. EDIT: too slow but yeah. Link to comment https://forums.phpfreaks.com/topic/148005-solved-deleting-first-entries-in-db/#findComment-776805 Share on other sites More sharing options...
contra10 Posted March 4, 2009 Author Share Posted March 4, 2009 ye thats it...thnks Link to comment https://forums.phpfreaks.com/topic/148005-solved-deleting-first-entries-in-db/#findComment-776807 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.