$id1と$id2が未定義であるというエラーが表示されます。私はそれらに正しくアクセスしていませんか?そうでない場合、どうすれば正しくアクセスできますか?
$query = $this->db->query("SELECT * FROM churchMembers");
$row = $query->row();
if ($query->num_rows() != 0) {
if ($postingUserId == $row->cMuserId) { // check to see what church the posting user is a member of
$id1 = $row->cMchurchId; // if posting user is a member of a church set it to var id1
}
if ($userid == $row->cMuserId) { // check to see what church myuserid is a member of
$id2 = $row->cMchurchId; // if myuserid is a member of a church set it to var2
}
if ($id1 == $id2) { // if posting user and myuserid are a member of the same church process the following
echo json_encode(array('loggedIn' => true, 'isMembershipSame' => true));
}
elseif ($id1 != $id2) { // if posting user and myuserid are not a member of the same user process the following
echo json_encode(array('loggedIn' => true, 'isMembershipSame' => false));
}
}