mitch.craig Posted August 29, 2008 Share Posted August 29, 2008 I know this should be simple but im trying to select everything from the entry with the highest Id (i.e the most recent entry) I have tried a few ideas but i just keep getting "supplied argument is not a valid MySQL result resource". Please help. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted August 29, 2008 Share Posted August 29, 2008 post what you have so far...but it should look something like: SELECT * FROM `tablename` ORDER BY `id` DESC LIMIT 1 Quote Link to comment Share on other sites More sharing options...
fenway Posted August 29, 2008 Share Posted August 29, 2008 That error message means you didn't execute a sucessful query... but MAX(id) is the better way to go... the question is why you need this. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted August 29, 2008 Share Posted August 29, 2008 ...im trying to select everything from the entry with the highest Id (i.e the most recent entry)... ...so use mine, not the MAX() way as that will only get you the ID Quote Link to comment Share on other sites More sharing options...
fenway Posted August 29, 2008 Share Posted August 29, 2008 Oops, missed the "everything" part... Quote Link to comment Share on other sites More sharing options...
mitch.craig Posted August 29, 2008 Author Share Posted August 29, 2008 Thanks. That worked perfectly!! Quote Link to comment 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.