Page 1 of 1

PHP and Stored Procedures

Posted: Thu May 12, 2005 1:58 pm
by farid
Hi y'all!!

Well hoping someone knows about sp in mssql, Im trying to run a strored procedured with one value as a parameter called folio, and it must return a value called distribuidor. It obviously doesn´t works so my problem that appear is somewhat this:

Warning: mssql_execute(): message: @folio is not a parameter for procedure sp_fichasEstrategiasComD. (severity 16) in D:\inetpub\InetGREGION9\php\fichas\testing.php on line 140

Warning: mssql_execute(): stored procedure execution failed in D:\inetpub\InetGREGION9\php\fichas\testing.php on line 140

Warning: mssql_fetch_row(): supplied argument is not a valid MS SQL-result resource in D:\inetpub\InetGREGION9\php\fichas\testing.php on line 142

and my code is:

Code: Select all

<?php  
                $folio_reclamante=902050166854; 
                  $conn=mssql_connect("ip", "estracom", "comerciales") or die("Couldn't connect"); 

                $base=mssql_select_db("comision", $conn) or die ("Couldn´t connect"); 
                $stmt=mssql_init("sp_fichasEstrategiasComd", $conn); 
                $value = $folio_reclamante; 
                mssql_bind($stmt, "@folio", $value, SQLCHAR, false); 

                $result = mssql_execute($stmt); 

                while ($arr=mssql_fetch_row($result)) 
                echo $arr[2]; 
                unset($stmt); 
                mssql_close($conn); 
              ?>
:?

Posted: Thu May 12, 2005 4:24 pm
by farid
resolved!! problems were find in the sp section, it wasn´t properly defined, so if anyone wants to make a consult to a sp in a mssql server, the php program that i attached it should help!! 8)