From: [EMAIL PROTECTED]
Operating system: soliars,win2000
PHP version: 4.0.4pl1
PHP Bug Type: Unknown/Other Function
Bug description: exec sybase procedure in .php but only ' 0 'returns!
I defined the sybase procedure as following:
*******************************************************
create proc circul.circul_hold
@rec_ctrl_id char(10),
@reader_barcode char(14),
@department_id char(2),
@user_id char(4),
@list_no int output,
@errmsg varchar(200) output
as
......
***********************************************************
and I ececuted this proc in test.php as fllowing:
<?php
include "../include/connect.php";
....
$rec_ctrl_id='15400';
$barcode='21113000694135';
$departid='70';
$userid = 'web';
$sql = "declare @list_no2 int, @errmsg2 varchar(200) ";
$sql.= "exec circul.circul_hold
'$rec_ctrl_id','$barcode','$departid','$userid',@list_no
=@list_no2 output,@errmsg=@errmsg2 output ";
$sql.= "select list_no = @list_no2 , errmsg = @errmsg2";
$query=sybase_query($sql);
if ($query){
$array = sybase_fetch_array($query);
echo $array[list_no] .'<br>';
echo $array[errmsg] .'<br>';
}
...
?>
I found that $array[list_no]=$array[list_no]=null,and
sybase_num_rows($query)=1 and $array[0]= 0,which means
only '0' returns (while the sybase proc excute succeed,it always return
0).
But I execute $sql in SYBASE SQL ADVANTAGE ,I can get
$array[list_no] and $array[errmsg] ,whilch are not null.
Why?I have been confused for months.
Please tell me the right way to execute sybase proc with output parameters
in php as soon as possible.
--
Edit bug report at: http://bugs.php.net/?id=13735&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]