【问题标题】:how to show output after executing stored procedure in mssql and php如何在mssql和php中执行存储过程后显示输出
【发布时间】:2011-09-25 19:41:23
【问题描述】:
$server = 'x.x.x.x\SQLEXPRESS';

// Connect to MSSQL
$link = mssql_connect($server, 'username', 'password');

if (!$link) {

    die('Something went wrong while connecting to MSSQL');
}
else
{
    echo "Connected!";``
}

$selected = mssql_select_db('dbname', $link)
    or die("Couldn't open database ")

$proc = mssql_init('sp_Index', $link);
$proc_result = mssql_execute($proc);

如何显示 $proc_result 的结果。我的存储过程是 sp_index。我不知道结构 sp_index

【问题讨论】:

    标签: php sql-server stored-procedures


    【解决方案1】:

    mssql_fetch_array() 呢?

    while ($row = mssql_fetch_array($proc_result)
    {
        // Do your thing with $proc['column_name']
    }
    

    【讨论】:

      猜你喜欢
      • 2014-04-26
      • 1970-01-01
      • 2014-08-08
      • 1970-01-01
      • 2013-01-12
      • 1970-01-01
      • 2018-09-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多