PHP和Microsoft SQL Server的存储过程

I'm looking for a solution for my project with PHP and MSSQL (Stored Procedure)..I hope anyone can help me to fix it..Here my PHP code..what I want doing right now for register user function..My stored procedure :sp_register_info

<?php
    session_start();

    header('Content-type: text/json');
    header("Cache-Control: no-cache, must-revalidate");

    $name = $_REQUEST['data1'];
    $email = $_REQUEST['data2'];


    MSSQL();
    register_user($name,$email);

    function MSSQL(){
        require_once "../myDB.php";
            Connect_MSSQL();
    }

    function register_user($name,$email) {

            global $DBIn;

            $query =    "DECLARE @UserID varchar(20)".
                        "DECLARE @Name varchar(20)".
                        "DECLARE @Email varchar(200)".
                        "SET @Name = $name".
                        "SET @Email  = $email".
                        "EXEC sp_register_info @Name, @Email,@UserID OUTPUT".
                        "select @UserID";

            $data = array($name,$email);  

            $res =& $DBIn->query($query,$data);

            if ($res->numRows() > 0) {

                    while($row =& $res->fetchRow(DB_FETCHMODE_ASSOC)){
                            $UserID = $row['UserID'];
                    }
                    loadSuccess(UserID); 
            }

            else {

                    loadFailed();
            }

    }


    function loadSuccess($UserID) {

    header("Content-Type: application/json");
        exit(json_encode(array(

                    'UserID'    => $UserID,
                    'success'       => 'true',

        )));
    }
    function loadFailed(){

        exit(json_encode(array(

            'success'  => 'false',

        )));
    }       
?>

This code not work for me..