tennen
Guest
не могу заставить mssql_bind работать
PHP Version 4.3.1, Apache 1.3.27, linux
написал небольшую процедуру на mssql
CREATE PROCEDURE phpuser.updateRequestHeadGLN
@orderIdentification char(20),
@seller char(14),
@buyer char(14),
@shipTo char(14)
AS
declare
@seller_w char(14),
@buyer_w char(14),
@shipTo_w char(14),
@LastUpdateDate datetime
Set @LastUpdateDate = GetDate()
select @seller_w = seller, @buyer_w = buyer, @shipTo_w = shipTo
from RequestHead
where orderIdentification = @orderIdentification and (seller<>@seller or buyer = @buyer
or shipTo <> @shipTo )
if @@RowCount = 1
update RequestHead
set seller = @seller, buyer = @buyer, shipTo = @shipTo, LastUpdateDate =
@LastUpdateDate
where orderIdentification = @orderIdentification
GO
И текст на php вызова процедуры
if (isset($seller) && !empty($seller) && isset($buyer) && !empty($buyer) &&
isset($shipto) && !empty($shipto)) {
$storeProc = mssql_init('updateRequestHeadGLN',$con);
mssql_bind($storeProc,"@orderIdentification",$idoc,SQLCHAR,false);
mssql_bind($storeProc,"@seller",$seller,SQLCHAR,false);
mssql_bind($storeProc,"@buyer",$buyer,SQLCHAR,false);
mssql_bind($storeProc,"@shipTo",$shipto,SQLCHAR,false);
$result = mssql_execute($storeProc);
И попытка выполнить данный текст выдает ошибку, ругаю строку $result =
mssql_execute($storeProc);
Warning: mssql_execute() [function.mssql-execute]: message: Procedure
'updateRequestHeadGLN' expects parameter '@orderIdentification', which was not supplied.
(severity 16) in /srv/www/htdocs/mail/testproc.php on line 48
Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failed in
/srv/www/htdocs/mail/testproc.php on line 48
зато работа со следующим кодом идет на ура
$te="EXECUTE updateRequestHeadGLN ".$idoc.",".$seller.",".$buyer.",".$shipto;
mssql_query($te);
PHP Version 4.3.1, Apache 1.3.27, linux
написал небольшую процедуру на mssql
CREATE PROCEDURE phpuser.updateRequestHeadGLN
@orderIdentification char(20),
@seller char(14),
@buyer char(14),
@shipTo char(14)
AS
declare
@seller_w char(14),
@buyer_w char(14),
@shipTo_w char(14),
@LastUpdateDate datetime
Set @LastUpdateDate = GetDate()
select @seller_w = seller, @buyer_w = buyer, @shipTo_w = shipTo
from RequestHead
where orderIdentification = @orderIdentification and (seller<>@seller or buyer = @buyer
or shipTo <> @shipTo )
if @@RowCount = 1
update RequestHead
set seller = @seller, buyer = @buyer, shipTo = @shipTo, LastUpdateDate =
@LastUpdateDate
where orderIdentification = @orderIdentification
GO
И текст на php вызова процедуры
if (isset($seller) && !empty($seller) && isset($buyer) && !empty($buyer) &&
isset($shipto) && !empty($shipto)) {
$storeProc = mssql_init('updateRequestHeadGLN',$con);
mssql_bind($storeProc,"@orderIdentification",$idoc,SQLCHAR,false);
mssql_bind($storeProc,"@seller",$seller,SQLCHAR,false);
mssql_bind($storeProc,"@buyer",$buyer,SQLCHAR,false);
mssql_bind($storeProc,"@shipTo",$shipto,SQLCHAR,false);
$result = mssql_execute($storeProc);
И попытка выполнить данный текст выдает ошибку, ругаю строку $result =
mssql_execute($storeProc);
Warning: mssql_execute() [function.mssql-execute]: message: Procedure
'updateRequestHeadGLN' expects parameter '@orderIdentification', which was not supplied.
(severity 16) in /srv/www/htdocs/mail/testproc.php on line 48
Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failed in
/srv/www/htdocs/mail/testproc.php on line 48
зато работа со следующим кодом идет на ура
$te="EXECUTE updateRequestHeadGLN ".$idoc.",".$seller.",".$buyer.",".$shipto;
mssql_query($te);