How to display header for rows returns from MySQL grouped by date for listview
===

I am trying to pull messages form mysql, group them by date, and display the results in listview with a header for each date.  

I figured out how to group by date from mysql and order by desc timestamp.  

My mind is blocked on how to display only one header for each date since is row is return using the while() function from php.  Can someone shed some light?

Here's what I have so far. 

    $st = $this->db->prepare("SELECT date(timestamp) as date, message, user_id, target_id, msg_id, msg_type, target_name FROM message WHERE (user_id=? OR target_id=?) GROUP BY date ORDER BY timestamp DESC");
    		$st->bindParam(1, $y['user_id'], PDO::PARAM_INT);
    		$st->bindParam(2, $y['user_id'], PDO::PARAM_INT);
    		$st->execute();
    		
    		echo'<ul data-role="listview" id="message_listview">';
    	
    		if($st->rowCount() < 1){
    			echo'You have no messages';
    			exit();
    		}		
    	
    		while($row = $st->fetch(PDO::FETCH_OBJ)){