I am trying to get max(date) ,count(id) and *look_name for max(date)* from this table:
id | member_id | look_week | look_name | is_pinned | date
1 | 1 | 3 | the improviser | yes | 2013-11-19 21:57:04
2 | 1 | 2 | destined for stardom | yes | 2013-11-19 21:56:00
2 | 1 | 1 | fashinably corporate | no | 2013-11-19 21:54:00
This is my query:-
$sql="SELECT COUNT(id) as total_pins,MAX(pinned_date) as last_activity_date FROM pin_info WHERE member_id='1' AND is_pinned='yes'";
I am getting this array as out put.
//[total_pins] => 2
//[last_activity_date] => 2013-11-19 21:57:04
//[lookname_for_last_date] => i am stuck at this?
How can I manipulate this query so that i can get look_name for max(date) in this array?