I simply need to select the last entered row specified by condition, e.g:
SELECT ID from bugs WHERE user=Me
I need to return only the very
You can use ORDER BY ID DESC, but it's WAY faster if you go that way:
SELECT * FROM bugs WHERE ID = (SELECT MAX(ID) FROM bugs WHERE user = 'me')
In case that you have a huge table, it could make a significant difference.
EDIT
You can even set a variable in case you need it more than once (or if you think it is easier to read).
SELECT @bug_id := MAX(ID) FROM bugs WHERE user = 'me';
SELECT * FROM bugs WHERE ID = @bug_id;
Just after running mysql query from php
get it by
$lastid=mysql_insert_id();
this give you the alst auto increment id value
SELECT ID from bugs WHERE user=Me ORDER BY CREATED_STAMP DESC; BY CREATED_STAMP DESC fetches those data at index first which last created.
I hope it will resolve your problem