Select distinct then calculate a number
The query you want is the following

SELECT headline,SUM(number) as sum_number
FROM table WHERE user = '$login_session'
GROUP BY headline;


You can make SQL echo the result by putting that query in a subquery

SELECT
    CONCAT('$login_session has ',headline,' ',sum_number,'&lt;/BR&gt;') as result
FROM
(
    SELECT headline,SUM(number) as sum_number
    FROM table WHERE user = '$login_session'
    GROUP BY headline
) A;