+ 1
Database
I'm new to coding and trying to build an Android app, where you can track your cigarettes you smoked... So far I got a database where I can add values and display them again... Now I want to compare the last time I smoked with now... I'm stuck in getting the last entry of the database back! Maybe someone can help me out?
2 Answers
+ 1
SELECT * FROM `smoked` ORDER BY `date` DESC LIMIT 1
I'm making a lot of assumptions here about your tables. If you don't have a date field order it descending by the primary key which should be auto incrementing.
+ 1
Thank you Adam... You helped a lot....