clankill3r Posted June 10, 2011 Share Posted June 10, 2011 I get different persons in the tabel. How can i get the last tweet from a person? (can by by last date or highest tweet_id). I have this now which gets them all i think: function getLastTweet($twitter_id) { $query = "SELECT * FROM tweets WHERE twitter_id='$twitter_id'"; $data = execQuery($query); return $data; } Quote Link to comment https://forums.phpfreaks.com/topic/239006-get-one-element-out-of-databse-instand-of-all/ Share on other sites More sharing options...
Maq Posted June 10, 2011 Share Posted June 10, 2011 What's your table structure? You would do something similar to: "SELECT * FROM tweets WHERE twitter_id='$twitter_id' ORDER BY date DESC LIMIT 1"; Quote Link to comment https://forums.phpfreaks.com/topic/239006-get-one-element-out-of-databse-instand-of-all/#findComment-1228080 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.