MSSQL form conversion from MySQL to MSSQL

I have a form that I use on MySQL/PHP and need to convert it to MSSQL/PHP. This is the area that I’m struggling with, what am I doing wrong?
No error, when I submit the form it just reloads, not submitting any data to the DB.

<?php
            if (isset($_POST['Vendor_ID'])) { //Check for a field that is mandatory to do the inserted
            $Vendor_ID = sqlsrv_escape_string($_POST['Vendor_ID']);
            $ProductName_ID = sqlsrv_escape_string($_POST['ProductName_ID']);
            $version = sqlsrv_escape_string($_POST['version']);
            $serial = sqlsrv_escape_string($_POST['serial']);
            $ProductKey = sqlsrv_escape_string($_POST['ProductKey']);
            $Department_ID = sqlsrv_escape_string($_POST['Department_ID']);
            $ownername = sqlsrv_escape_string($_POST['ownername']);
            $Computer = sqlsrv_escape_string($_POST['Computer']);
            $Comments = sqlsrv_escape_string($_POST['Comments']);
            $Acquired = sqlsrv_escape_string($_POST['Acquired']);
            $Retired = sqlsrv_escape_string($_POST['Retired']);
        $sql = "INSERT INTO dbo.KeyList_detail (
                Vendor_ID,
                ProductName_ID,
                version,
                serial,
                ProductKey,
                Department_ID,
                Owner,
                Computer,
                Comments,        
                Acquired,
                Retired)
                    VALUES(
                    $Vendor_ID,
                    $ProductName_ID,
                    $version,
                    $serial,
                    $ProductKey,
                    $Department_ID,
                    $Owner,
                    $Computer,
                    $Comments,                    
                    $Acquired,
                    $Retired)";
        sqlsrv_query($con,$sql);
        if (sqlsrv_query($con, $sql)) {
            echo '<strong><em>Your data has been submitted</em></strong><br /><br />';
                } else {
            echo '<p>Error adding submitted info: ' . sqlsrv_error(). '</p>';
        }
        }
        ?>
        
        <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

Is this in the wrong section?

First off, you are calling the INSERT statement twice, so that’s not good. Second, look into http://php.net/manual/en/function.mssql-get-last-message.php, and Last, try putting a var_dump($sql); before your sqlsrv_query and paste that into SSMS to ensure it works there first.

As a second thought, I bet the var_dump copy and paste into SSMS will fail, because you don’t have single quotes around a few of your columns in the INSERT query that look to be strings. My guess, is that is your issue.

I added the ’ quotes and the same thing is happening.

What was the output of your var_dump($sql) call and were you able to copy and paste that query into SSMS and verify it runs?