PDA

View Full Version : PHP and Stored Procedures


farid
05-12-2005, 07:54 PM
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:

<?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);
?>
:thumbsup:

farid
05-12-2005, 10:23 PM
resolved!! there were probīs in the stored procedure!! :cool: