|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-10-18 09:47 UTC] wenk at bt-t dot com
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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 01:00:01 2025 UTC |
I've had a similar experience - the 0 returned is a failure notice, I believe. I got this error message when trying to connect ('db_name' is the name of the connection I use in the interfaces and hosts files): Notice: Connection failed to db_name,14224: Connection refused (errflg=2) in Unknown on line 0 I'm using PHP 4.2.1 with Apache 1.3.24, and have Sybase ase-11.0.3.3-6 and ocsd-10.0.4-6 installed. (Do I need *both* of these?) Never had this problem with an earlier combination of PHP 4.0.4pl1 and Apache 1.3.19 using the same ct lib files. I still haven't solved this one, so any help would be appreciated!