Skip to Content.
Sympa Menu

freetds - Re: [freetds] mssql_execute(): stored procedure execution failed

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Robert Gonzalez <robert AT robert-gonzalez.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] mssql_execute(): stored procedure execution failed
  • Date: Mon, 24 May 2010 09:27:32 -0700

mssql_init() essentially prepares a stored proc to be called as a prepared
statement with the possibility of placeholders added to it for multiple
calls using different params. mssql_bind() allows you to bind those
different params into the prepared statement for processing using the
mssql_execute() function.

mssql_query() takes the query as entered, sends it to the database server
and receives the response from the DB server, usually in the form of a
result resource handle. You can just as easily send stored procedure
requests using mssql_query() as you could using init, bind and execute.

On Mon, May 24, 2010 at 12:39 AM, Sylvain Viart - Gmail <
sylvain.viart AT gmail.com> wrote:

> Hi,
>
> On 23/05/2010 03:07, Robert Gonzalez wrote:
> >>>> t give any error messages when it doesn't work?
> >>>>
> >> PHP Warning: mssql_init(): unable to init stored procedure in
> >> read_msg.php on line 46
> >> PHP Warning: mssql_execute() expects parameter 1 to be resource,
> >> boolean given in read_msg.php on line 47
> >> PHP Warning: mssql_free_statement() expects parameter 1 to be resource,
> >> boolean given in read_msg.php on line 48
> >>
> >>
> > If possible, take the return from mssql_init() and check it for boolean
> > false. If it is, try to trap the error returned from the server with
> > mssql_get_last_message(). All of the errors you see after the
> mssql_init()
> > failure are because you are trying to pass a boolean value (in this case,
> a
> > FALSE) to functions that expect an initialized stored proc resource
> handle.
> >
>
> Yes, I gonna log that and report it back.
>
> No clue about the difference between mssql_init + mssql_bind versus
> mssql_query("EXEC ...")?
>
> Regards,
> Sylvain.
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>



--
Robert Gonzalez
http://www.robert-gonzalez.com
http://twitter.com/RobertGonzalez
http://www.linkedin.com/in/robertanthonygonzalez




Archive powered by MHonArc 2.6.24.

Top of Page