简体   繁体   中英

How can we call sql server stored procedure using odbc_exec in php

How can we call sql server stored procedure using odbc_exec in php.

I tried this code but it doesnt work:

include '../config2.php';

$sql = "EXEC MENTAL('F200', 'D', '39','41','1')";
$result=odbc_exec($baglanti, $sql);

while($query = odbc_fetch_array($result)) {
    $html .= $query['Code'] . ' ' . $query['CodeType'] . ' ' . 
             $query['TANIM'] . ' ' . $query['VakaSayısı'] . '<br>';
}    

echo $html;

Thanks

Ok Folks I found the solution: Sql statemtn must be like this:

$sql = "EXEC MENTAL @code='F200' , @Statu='D'";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM