Question: I am trying to build my first Outlook Add-In (not VSTO) and followed the tutorial [here](https://learn.microsoft.com/en-us/outlook/add-ins/quick-start?tabs=visual-studio). After setting up my Office 365 developer license/environment, I finally manage to compile/deploy the Add-In:

```
3>The manifest file "C:\Users\AAX\source\repos\MyProject\MyProject\bin\Debug\OfficeAppManifests\MyProject.xml" is being deployed to the Exchange server.
3>Successfully registered the mail app on the Exchange Server using service at https://outlook.office365.com/EWS/Exchange.asmx

```

The compile/deploy action ask me to sign to OWA which I can do but I do not see my Add-In.
I try to a track of my Add-in

1. Search under the OWA > Settings > Manage Add-in --> Nothing
2. Search under Exchange Admin > Settings > Add-In --> Nothing
3. I tried to deploy it manually using OWA: All Ok

The workaround 3 does not help as I want to be able to develop build/deploy in a convenient manner. Any hint on why the Visual Studio deploy does not work?

Answer: 
of course you will update the database every time you load the page because of this line

```
document.write("<?php a(); ?>");

```

every time you load the page you are calling `a()` which updates the database 

the reason of why function `a` is not echoing `"function executed"`, is it **DOES** but you don't see it on the page because it is echoed in it's line. I'm sure you will see it in the page source.

When the PHP parser parse your script it will produce and respond with this 

```
document.write("function executed");

```
You need to use [Ajax](https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX/Getting_Started) to call the PHP script by clicking on the `button`. Something like the following will work.

Do *not* include the PHP script on your page and the mysql will only be called after clicking the `button`.

```
<script type="text/javascript">
function ajax(url) {
    var http = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari, IE7+ ...
        http = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE 6 and older
        http = new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (! http) {
        // old browser or terminal maybe?
        return false;
    }
    http.onreadystatechange = function() {
        if ((http.readyState == 4) && (http.status == 200)) {
            // do stuff with the html/json/data returned
            // this alert will trigger once the PHP is run.
            alert(http.responseText);
        }
    }
    http.open('GET',url,true);
    http.send(null);
}

function b(){
    // call the code on PHP script to run.
    ajax("/path/to/your/php");
    //test if javascript function executes:
    // this alert should fire first.
    alert("function b() executed");
}
</script>

<button onclick="b()">Click me!</button>

```