minavio Posted March 19, 2003 Share Posted March 19, 2003 How do you issue an insert statement that will insert the entry to the beginning of the table, before all the other entries, each time? Any help would be greatly appreciated, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/240-inserting-before-the-first-entry/ Share on other sites More sharing options...
ystrigathe Posted March 19, 2003 Share Posted March 19, 2003 physically into the files? no way... Quote Link to comment https://forums.phpfreaks.com/topic/240-inserting-before-the-first-entry/#findComment-714 Share on other sites More sharing options...
minavio Posted March 19, 2003 Author Share Posted March 19, 2003 What I mean is, when I run a mysql_query (\"INSERT INTO ... command, it will sometimes append the new entry at the end of the table, sometimes at the beginning, sometimes in the middle... I don\'t know how to tell it to always insert the entry at the beginning of the table. Quote Link to comment https://forums.phpfreaks.com/topic/240-inserting-before-the-first-entry/#findComment-716 Share on other sites More sharing options...
ystrigathe Posted March 20, 2003 Share Posted March 20, 2003 if u deleted some records, the data file will contain a \'hole\'. If u insert a new record mysql will re-use these \'holes\'. So you have no chance to get control over this behaviour \'til you take the source and build the engine new. But how do you check for the order? A select-statement doesn\'t say anything about the physically order in the files; it\'s just in which order mysql proceeds the records... By the way: in most databases there\'s a possibility to defrag & re-organize your tables. But in this case, the new records will find a place at the end of the data file... Quote Link to comment https://forums.phpfreaks.com/topic/240-inserting-before-the-first-entry/#findComment-718 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.