jonalee
asked on
Call Sybase Store Procedure from PHP
Hello, I'm using PHP3.
I have installed the Sybase PHP3 support.
The question is how can I call the Store Procedure in Sybase using PHP.
Please give the sample
I have installed the Sybase PHP3 support.
The question is how can I call the Store Procedure in Sybase using PHP.
Please give the sample
ASKER
Stored Procedure is a SQL-Server script that run by the SQL server itself. It offer more scure, fater and Transaction function.
This should work if you tweak it about to suit your machine.
<?PHP
$sybase = sybase_connect();
sybase_dbuse("<Datebase Name>", $sybase);
$result = sybase_query("INSERT INTO temp etc...");
This should write the values into the table.
<?PHP
$sybase = sybase_connect();
sybase_dbuse("<Datebase Name>", $sybase);
$result = sybase_query("INSERT INTO temp etc...");
This should write the values into the table.
ASKER
Hey, I mean how to call Sybase Stored-Procedure using PHP's sybase function.
Your answer is just submit the SQL query.
The stored procedure I created in Sybase database like using the following line:
Create Procedure mmm
@number int,
@name varchar(50)
As
BEGIN TRANSACTION 'trans1'
INSERT INTO people (id,name) VALUES(@number,@name)
COMMIT TRANSACTION 'trans1'
The question is how to call the function mmm in PHP's sybase function.
Your answer is just submit the SQL query.
The stored procedure I created in Sybase database like using the following line:
Create Procedure mmm
@number int,
@name varchar(50)
As
BEGIN TRANSACTION 'trans1'
INSERT INTO people (id,name) VALUES(@number,@name)
COMMIT TRANSACTION 'trans1'
The question is how to call the function mmm in PHP's sybase function.
I'm not sure if this is possible, the functions which are available in PHP for sybase don't include something like sybase_call_procedure. Still I'll look for it.
Joseph
Joseph
You might wanna try this :
$result = sybase_sql("EXEC mmmm");
$arr = sybase_fetch_row($result);
Joseph
$result = sybase_sql("EXEC mmmm");
$arr = sybase_fetch_row($result);
Joseph
Have you tried it yet?
ASKER
I want to transfer the parameter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Joseph