I know someone can help !

Following sql

SELECT DISTINCT s_news_text,s_bereich_name,s_users_real_name,s_bereich_id
FROM s_news,s_users,s_bereich
WHERE (s_news_user_id = s_users_user_id)
AND (s_news_bereich_id = s_bereich_id)
AND (s_news_sent ='0')
ORDER BY s_bereich_name

while ($p = mysql_fetch_array($result1)) {

$msg .= $p["s_bereich_name"];
$msg .= $p["s_news_text"];
$msg .= $p["s_users_real_name"];

The result gets passed on and mailed !
The question is I have 6 bereichs(areas) identified with a number =
s_bereich_id and I only want the name of the area to appear once.
To try and explain a bit better, there are 3 tables -
users - where the names and mail addresses come from
bereich - where the areas name and numbers are
and news - where the actual messages are, and info for which area and from

The mail should then look like

Area 1
news                    name
news2                  name
news3                  name

Area 2
news                   name

at the moment I can only work out how to get
Area 1
news                     name
Area 1
news                     name

Anyhelp appreciated !

Thanks in advance

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to