[insert_php]
global $wpdb;
$result = $wpdb->get_results( "SELECT * FROM `wp_bp_activity` WHERE `user_id` = 158 AND `item_id` = 3609 ORDER BY `date_recorded` DESC”);
$Startdate = $result[2]->date_recorded;
$enddate = $result[0]->date_recorded;
$result5 = $wpdb->get_results( "select * FROM `wp_bp_activity` where ( subtime($Startdate,$enddate))”);
echo $Startdate . "
";
echo $enddate;
echo ‘
'; print_r($result5); echo '
‘;
[/insert_php]