I need to display a message to user so he can know that his email already exist in our database. I have this mehtod:

```
addPartners(partnerName, showMsg)
{
    showMsg = false;
    const headerOptions = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
    const body = new HttpParams().set('name', partnerName);
    return this.http.post('http://aff.local/addPartner.php', body, {
          headers: headerOptions
}).pipe(map(
    res=>{

      //console.log(res)
      if(res==null)
      {
        //alert("Your email already exist in our database");
        showMsg = true;
      }
      else{
        showMsg=false;
      }
    },
    error=>{
      console.log("Error: "+ error);
    }
  ))
 }

```

And I run it in my component on click:

```
addPartner(){
    this.email = this.subscribeForm.get('emailTxt').value;
    console.log("hi "+this.email);
    this.api.addPartners(this.email, this.showMsg).subscribe(
      (data)=>{
        console.log(this.showMsg);

        this.subscribeForm.reset();
      },
      (error)=>{
        console.log(error)
      }
    );
  }

```

In the DOM when `showMsg` is true, I will display the message:

```
<div class="container" *ngIf="showMsg">
   ...
</div>

```

My problem is that I always get at the console of `console.log(this.showMsg)` an `undefined` as returned value. That's why `showMsg` is always false even if the email already exists and I should display a message to user.

I tried to see the `data` value at the console:

`console.log(data);`

And I still get `undefined` at the console.

What I want exactly, is to change the value to true, when I already have the email in my database. Here is my php script to understand more:

```
public function addPartner($partner_name){
        global $conn;
        //$existingValueMsg = "Email already exists";
        $existingValue = "SELECT * FROM partner WHERE partner_name=:partner_name";
        $execExistingValue=$conn->prepare($existingValue);
        $execExistingValue->bindValue(":partner_name", $partner_name);
        $execExistingValue->execute();
        $execExistingValue->fetchAll();
        $resultNumber = $execExistingValue->rowCount();
        if($resultNumber==0)
        {
            $addParner = "INSERT INTO partner(partner_name, image) VALUES(:partner_name, '')";
            $execAddPartner = $conn->prepare($addParner);
            $execAddPartner->bindValue(":partner_name", $partner_name);
            $execAddPartner->execute();

            return true;
        }
        else
        {
            //return $existingValueMsg;
            return false;
        }
    }

```

When false, at the typescript method the returned value is `null`.