$serverName = "";
$namedatabase="";
$username="";
$password="";
$connectionInfo = array("Database" => $namedatabase, "CharacterSet" => "UTF-8", "UID" => $username, "PWD" => $password);
$conn= sqlsrv_connect($serverName, $connectionInfo) or die("خطا در اتصال به بانک اطلاعاتی");
$sql = "insert into temp_azmoon (code_temp) VALUES (?)";
$stmt = sqlsrv_prepare( $GLOBALS['conn'], $sql, array("ali"));
sqlsrv_execute( $stmt );
if( sqlsrv_execute( $stmt ) === false ) {
die( print_r( sqlsrv_errors(), true));