From: Steve Sutton Date: Wed, 12 Jun 2013 17:12:26 +0000 (+0000) Subject: rework the county part in query so if they don't have a county assigned they can... X-Git-Tag: v1.0~119 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=cb3e101bcc98696b2a41a758c117eea603e33653;p=web%2FMichiganTrailMaps.git rework the county part in query so if they don't have a county assigned they can get all fields --- diff --git a/Toolkit/Members/ProfilePage.php b/Toolkit/Members/ProfilePage.php index 0ef216d..75a5a57 100644 --- a/Toolkit/Members/ProfilePage.php +++ b/Toolkit/Members/ProfilePage.php @@ -473,16 +473,14 @@ class Toolkit_Members_ProfilePage s.state_abb AS state_abbr FROM member m LEFT OUTER JOIN city c ON (m.city_id = c.city_id) - LEFT OUTER JOIN state s ON (m.state_id = s.state_id), - county ct - WHERE m.member_id = :mid - AND m.state_id = s.state_id - AND m.county = ct.county_id"; + LEFT OUTER JOIN state s ON (m.state_id = s.state_id) + LEFT OUTER JOIN county ct ON (m.county = ct.county_id) + WHERE m.member_id = :mid"; $stmt = $this->dbh->prepare($sql); $stmt->bindParam(':mid', $this->_mid, PDO::PARAM_INT); $stmt->execute(); - $row = $stmt->fetch(); + $row = $stmt->fetch(PDO::FETCH_ASSOC); if (!empty($row['logo'])) { $page->logo = $row['logo'];