MySQL Forums
Forum List  »  Stored Procedures

Re: Calling stored procedure from PHP
Posted by: Arjen Lentz
Date: July 14, 2005 06:31PM

Cesar Aguirre wrote:
> hi, can anyone hel me?... I'm trying to do it in
> php, but I can't to get te result, I'm doing this:
>
> [...]
> $result=mysql_query($s,"SELECT @result");
> print_f($result)

The problem is very simply that your PHP script is not complete.
You should check $result, if it's zero then you want to print mysql_errno() and mysql_error().
If it's non-zero, then you need to actually get the result data! $result from mysql_query() will *NOT* contain the actual data, it just returns a result handle (or zero).
See php.net/mysql_query for code examples.

Regards, Arjen.
--
Arjen Lentz, Exec.Director @ Open Query (http://openquery.com)
Remote expertise & maintenance for MySQL/MariaDB server environments.

Follow us at http://openquery.com/blog/ & http://twitter.com/openquery

Options: ReplyQuote


Subject
Views
Written By
Posted
59404
March 18, 2005 05:58PM
8437
November 26, 2008 05:09AM
22261
April 25, 2005 01:10PM
Re: Calling stored procedure from PHP
7571
July 14, 2005 06:31PM
3962
October 22, 2006 10:03PM
4056
November 03, 2006 02:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.