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; } 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"; 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
Archived
This topic is now archived and is closed to further replies.