php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13736 exec sybase procedure in .php but only ' 0 'returns!
Submitted: 2001-10-18 09:48 UTC Modified: 2001-10-18 09:55 UTC
From: wenk at bt-t dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.0.4pl1 OS: soliars,win2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wenk at bt-t dot com
New email:
PHP Version: OS:

 

 [2001-10-18 09:48 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-18 09:55 UTC] derick@php.net
Submitted twice, status: bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 01 10:01:30 2024 UTC