note 20660 deleted from function.mssql-execute by didou
| From: | didou@php.net | Date: | Sun, 04 Feb 2007 06:05:21 +0000 |
| Subject: | note 20660 deleted from function.mssql-execute by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122801@lists.php.net to get a copy of this message | ||
Note Submitter: duarte at uma dot pt
----
Solution to execute MSSQL Stored Procedures in PHP Linux :
The functions mssql_* in PHP Win are no equal to mssql_* in PHP Linux
In Linux the functions for mssql_* in PHP are just ALIAS of the sybase functions. You can see that
if you consult the PHP Source files or go to PHP CVS.
And because of this, some functions are available in PHP Win an not in PHP Linux. Like
mssql_execute(), mssql_init(), ...
The solution to work with MS-SQL stored procedures in PHP Linux Server is to:
1- Execute the stored procedure with: "mssql_query( "EXECUTE stored_procedure_1(@a,@b)
" ,$vi_connect )
2- And in the stored procedure you can´t get the returned parameters in the normal way, you must do
"Select @a as a, @b as b " and the end of the code of your stored procedure.
3- After, you can use mssql_fetch_array to get the result of the stored procedure.
This is working in project with
Database Server:
Windows 2000 + MS-SQL Server 7.0
Web Server
SUSe Linux 7.0 + Apache 1.3.19 + PHP 4.1.6 ( with freetds-0.53 )
I hope this helps someone !