JOIN instead of LEFT JOIN on committee members link, incase a member has been deleted we dont want a blank record..

though.. if they have been deleted we should probably delete the link.. hmmm.. well.. this will hide it for now.
This commit is contained in:
james 2010-01-04 17:51:55 +00:00
parent 34d1c02c1d
commit 3f94324aba

View File

@ -197,8 +197,7 @@ if($_POST['action']=="remove") {
echo happy(i18n("Committee member deleted"));
}
if($_GET['unlinkmember'] && $_GET['unlinkcommittee'])
{
if($_GET['unlinkmember'] && $_GET['unlinkcommittee']) {
$mem = intval($_GET['unlinkmember']);
$com = intval($_GET['unlinkcommittee']);
//unlink the member from the committee
@ -306,10 +305,18 @@ if($_GET['unlinkmember'] && $_GET['unlinkcommittee'])
echo "&nbsp; <b>$r->name</b>";
$q2=mysql_query("SELECT committees_link.title,committees_link.ord,users.uid,MAX(users.year),users.lastname
FROM committees_link LEFT JOIN users ON users.uid = committees_link.users_uid
$q2=mysql_query("SELECT
committees_link.title,
committees_link.ord,
users.uid,
MAX(users.year) AS my,
users.lastname
FROM committees_link
JOIN users ON users.uid = committees_link.users_uid
WHERE committees_id='{$r->id}'
GROUP BY users.uid ORDER BY ord,users.lastname ");
GROUP BY users.uid
ORDER BY ord,
users.lastname ");
if(mysql_num_rows($q2)==0) {
echo "&nbsp; &nbsp;";