我从两个表中选择行
然后我正在接收数组$a = mysql_query("选择 a.id, a.id_user, a.id_location, a.id_event, a.date FROM 事件作为 LEFT JOIN 评级为 b ON a.id_event = b.id_event AND a.id_user = b.id_whos_get_rate 在哪里 a.id_user <> $log1[id] AND 存在 ( 选择 1 FROM 事件作为 c 其中 a.id_event = c.id_event 和 c.id_user = $log1[id] ) 和 b.id IS NULL ORDER BY DATA") ;
a.id | a.id_user | a.id_location | a.id_event | 一个约会 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++ 1 2 1 2 20.03.2013 2 3 1 2 20.03.2013 3 4 1 2 20.03.2013 4 12 1 3 20.03.2013 5 13 1 3 20.03.2013 6 14 1 3 20.03.2013
然后我想回显该值并由每个用户添加收音机,我正在这样做:
<pre>>while($b = mysql_fetch_array($a)){
>$place = mysql_query("select * from name_event where id=$b[id_location]");
>$place1= mysql_fetch_array($place);
>echo $place1[name];
>echo $b[date].;
>echo "id event: ".$b[id_event].;
>$name= mysql_query("select* from users where id='".$b[id_user]."'and id!=$log1[id]");
>$name1= mysql_fetch_array($name);
>if (!empty($name1[login])){
>echo $name1[login]. ;
>echo "form method ='post' action ='rate.php'
>rate
>input type='radio' name='s' value='$name1[id]|1|$b[id_event]'
>input type='radio' name='s' value='$name1[id]|2|$b[id_event]'
>input type='submit' name='submit' value='value'
问题是 a.id_event 有多个值,我不知道如何将代码更改为仅回显一次 a.id_event ,然后是所有参与该事件的用户,因为目前它是回显
id_event 2 id_user 2 id_event 2 id_user 3 id_event 2 id_user 4
我期待像那样工作
id_event 2 id_user 2 id_user 3 id_user 4