FlyingIsFun1217 Posted June 23, 2008 Share Posted June 23, 2008 Hey! For a project I have, table results are returned in what seems to be a FIFO order (as in the first result, row 0, is returned first, and the last row will be returned last), and since I want to have new results returned first, I would like to insert new results into the table 'at the top'. Is there an easy way to do insert operations at row 0? Thanks! FlyingIsFun1217 Link to comment https://forums.phpfreaks.com/topic/111572-solved-how-to-insert-row-0/ Share on other sites More sharing options...
MadnessRed Posted June 23, 2008 Share Posted June 23, 2008 this is a complete guess but would it be done like this? ALTER TABLE `##table name##` ADD `##new news##` BEFORE `##Whatever is first atm##` ; Link to comment https://forums.phpfreaks.com/topic/111572-solved-how-to-insert-row-0/#findComment-572708 Share on other sites More sharing options...
FlyingIsFun1217 Posted June 23, 2008 Author Share Posted June 23, 2008 Ok, I see how I could go about doing that. I found it easier to just add a 'number' field, set it to auto_increment, and sort descending by it. Thanks for your help! FlyingIsFun1217 Link to comment https://forums.phpfreaks.com/topic/111572-solved-how-to-insert-row-0/#findComment-572737 Share on other sites More sharing options...
MadnessRed Posted June 23, 2008 Share Posted June 23, 2008 like mikelmao is doing. http://www.phpfreaks.com/forums/index.php/topic,203375.0.html Link to comment https://forums.phpfreaks.com/topic/111572-solved-how-to-insert-row-0/#findComment-572743 Share on other sites More sharing options...
FlyingIsFun1217 Posted June 24, 2008 Author Share Posted June 24, 2008 like mikelmao is doing. http://www.phpfreaks.com/forums/index.php/topic,203375.0.html That was quite comical. Either way, I've fixed it. Thanks! FlyingIsFun1217 Link to comment https://forums.phpfreaks.com/topic/111572-solved-how-to-insert-row-0/#findComment-572854 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.