|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35704 function mssql-execute: stored procedure execution failed
Submitted: 2005-12-16 11:00 UTC Modified: 2005-12-16 13:59 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: frodriguez at isastur dot es Assigned: fmk (profile)
Status: Not a bug Package: MSSQL related
PHP Version: 5.1.1 OS: SuSe Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: frodriguez at isastur dot es
New email:
PHP Version: OS:


 [2005-12-16 11:00 UTC] frodriguez at isastur dot es
I have Apache, PHP 5.1.1 rebuilding with the mssql extension instead of the sybase extension and FreeTDS 0.63.

Note that the problem is in LINUX S.O. not in W2000 Server like in many other bug reports.

I try to execute a stored procedure site in a W2000 Server with SQL Server 2000 SP3.

The stored procedure haven't any parameter.

If I use mssql_query() work's correctly but if I use mssql_init() and mssql_execute the error take place.

The stored procedure do nothing, it's only for test purposes.

Thanks a lot.

Reproduce code:
echo "<br>CONECTADO<br>";
$c = mssql_connect ('XXX.XXX.XXX.XXX', 'user', 'pwd');
if (mssql_select_db ("DATABASENAME", $c) == true)
  //mssql_query("EXEC Test", $c);  
  $p = mssql_init("Test", $c);
  $result = mssql_execute($p);
  if (!$result)
    $message = "Last message from SQL : " . mssql_get_last_message() . "";
    echo $message;
echo "<br>FINALIZANDO<br>";

Expected result:
Execute the stored procedure "Test"

Actual result:


Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failed in /usr/local/httpd/htdocs/FRF_Pruebas/PruebaExecute.php on line 15
Ultimo mensaje desde SQL : Changed database context to 'DATABASENAME'.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-16 11:05 UTC]
assigned to the maintainer.
 [2005-12-16 13:53 UTC] frodriguez at isastur dot es
Thanks a lot to Maxime MARAIS to solve my problem.

The solution is:

I'm connecting to a SQL Server using an IP address. The default TDS version used by freetds is less 
than 8.0. 
Version 8.0 is mentionary in order to execute stored procedures. So, I have to modify the freetds.conf to something like 
this :
# My Microsoft SQL Server 2000 configuration
        host = XXX.XXX.XXX.XXX ; Your MSSQL Server IP adress
        port = 1433
        tds version = 8.0

In my PHP code, then I use the following :
$c = mssql_connect ('TheNameYouWant', 'user', 'password');

Thanks "egein" to Maxime MARAIS
 [2005-12-16 13:59 UTC]
Not PHP problem -> bogus.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC