Hello,
I am new to PHP
I have a t-sql based stored procedure which I want to execute via PHP, I have tried all odbc_prepare, odbc_execute and odbc_exec but somehow I have not been able to execute the SP.
The SP is perfectly fine as it executes properly from SQL API.
Is there a PHP setting that I need to turn on / enable for this?
Thanks in advance for your help
Executing Sql-Server Stored Procedure using PHP
Moderator: General Moderators
-
focusbizla
- Forum Newbie
- Posts: 2
- Joined: Mon Jun 23, 2008 4:41 pm
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Executing Sql-Server Stored Procedure using PHP
What is you SQL? Usually it is something like:
Code: Select all
oci8_execute("BEGIN myStoredProc(param1, param2...) END");(#10850)
-
focusbizla
- Forum Newbie
- Posts: 2
- Joined: Mon Jun 23, 2008 4:41 pm
Re: Executing Sql-Server Stored Procedure using PHP
I am using sql server so I am using mssql_execute, odbc_execute and other mssql functions, the begin...end before the sp name works when I am running it in sql-server, but not when I am using PHP code
Re: Executing Sql-Server Stored Procedure using PHP
I have a similar problem.
I am pretty new to PHP and am a bit stuck.
I am working on calling a stored procedure in MSSQL using PHP. My PHP is running on Linux and my MSSQL database is running on Windows. I am using php_odbc to connect. I need to fix the obdc_execute commands in my script. I don't have them right.
Here is my old call that worked with mssql:
$sp = mssql_init("sp_encrypt_text"); // stored proc name
mssql_bind($sp, "@unencrypted", ($extpassword), SQLVARCHAR, false, false, 255);
mssql_bind($sp, "@return_encrypted", ($extpassword), SQLVARCHAR, true, false, 255);
mssql_execute($sp);
How do I change the mssql_init, mssql_bind and mssql_execute statements into odbc_execute statements?
Does anyone know?
I am pretty new to PHP and am a bit stuck.
I am working on calling a stored procedure in MSSQL using PHP. My PHP is running on Linux and my MSSQL database is running on Windows. I am using php_odbc to connect. I need to fix the obdc_execute commands in my script. I don't have them right.
Here is my old call that worked with mssql:
$sp = mssql_init("sp_encrypt_text"); // stored proc name
mssql_bind($sp, "@unencrypted", ($extpassword), SQLVARCHAR, false, false, 255);
mssql_bind($sp, "@return_encrypted", ($extpassword), SQLVARCHAR, true, false, 255);
mssql_execute($sp);
How do I change the mssql_init, mssql_bind and mssql_execute statements into odbc_execute statements?
Does anyone know?