catri3l Posted May 22, 2008 Share Posted May 22, 2008 Hey. Couple of weeks ago i got help on a code which worked great! (thanks) The code was to fetch a friends action feed from the db. However ive noticed that when a buddy becomes friends with another person on the site, all the actions from that person are added to the feed, making the list confusing. Because it displays and mixes all the actions of a new user with the existing ones here is the code: <?php $fetch_feed = sql_query("SELECT * FROM joovili_buddies jb JOIN joovili_buddy_feed jbf ON (jb.buddy_buddy = jbf.feed_username) WHERE jb.buddy_username = '{$_COOKIE['session_username']}' AND jb.buddy_status='1' ORDER BY jbf.id DESC LIMIT 15"); while ($feed = mysql_fetch_array($fetch_feed)){ ?> There is a buddy_date (which i added to the data base) and it shows the date those two person became friends. Is it possible to display the feed from a person starting from the date they became friends? Thanks! Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/ Share on other sites More sharing options...
realjumper Posted May 22, 2008 Share Posted May 22, 2008 Yes it's possible, but it depends on what type of field 'buddy_date' is. Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/#findComment-546978 Share on other sites More sharing options...
catri3l Posted May 22, 2008 Author Share Posted May 22, 2008 it shows the date like this: 11th Apr 2008 at 20.40 it is also shown like that on the data base, not random numbers. I can change the date to anything it will not be a problem. Just tell me the date i need and i will show it. Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/#findComment-546979 Share on other sites More sharing options...
catri3l Posted May 22, 2008 Author Share Posted May 22, 2008 I can change the field to anything as well, just tell me what ever is better right now im just using `buddy_date` varchar(200) NOT NULL default '0', Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/#findComment-546981 Share on other sites More sharing options...
realjumper Posted May 22, 2008 Share Posted May 22, 2008 I would set buddy_date as a 'timestamp' or 'int', and then insert (as a timestamp) the time & date when they became buddies. Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/#findComment-546983 Share on other sites More sharing options...
catri3l Posted May 22, 2008 Author Share Posted May 22, 2008 ok, and after that how would i fetch them? Btw thank you! Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/#findComment-547001 Share on other sites More sharing options...
catri3l Posted May 22, 2008 Author Share Posted May 22, 2008 Anyone please :-\ Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/#findComment-547029 Share on other sites More sharing options...
catri3l Posted May 22, 2008 Author Share Posted May 22, 2008 :-\ Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/#findComment-547282 Share on other sites More sharing options...
catri3l Posted May 22, 2008 Author Share Posted May 22, 2008 how can this be done? Anyone? Im stuck on this thing since yesterday... Pelase? Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/#findComment-547401 Share on other sites More sharing options...
catri3l Posted May 23, 2008 Author Share Posted May 23, 2008 is it that hard? Link to comment https://forums.phpfreaks.com/topic/106703-fetching-from-a-specific-date-and-on/#findComment-547822 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.