Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5F4E29FA49D; Tue, 17 Apr 2007 03:08:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 60173-06; Tue, 17 Apr 2007 03:08:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 929329FB2C6; Tue, 17 Apr 2007 03:08:42 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from pat.uio.no (pat.uio.no [129.240.10.15]) by svr4.postgresql.org (Postfix) with ESMTP id 2D4675AF028; Tue, 17 Apr 2007 06:08:39 +0000 (GMT) Received: from mail-mx6.uio.no ([129.240.10.47]) by pat.uio.no with esmtp (Exim 4.66) (envelope-from ) id 1Hdgre-0005ik-Mg; Tue, 17 Apr 2007 08:08:30 +0200 Received: from inhaca.uio.no ([129.240.202.141]) by mail-mx6.uio.no with esmtp (Exim 4.66) (envelope-from ) id 1Hdgrd-0005z1-Ey; Tue, 17 Apr 2007 08:08:30 +0200 Message-ID: <4624645D.70002@gildseth.com> Date: Tue, 17 Apr 2007 08:08:29 +0200 From: Tommy Gildseth User-Agent: Thunderbird 1.5.0.10 (X11/20070221) MIME-Version: 1.0 To: Karthikeyan Sundaram Cc: postgres sql , pgsql-php-owner@postgresql.org Subject: Re: quesion on functions calling from php References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-UiO-Spam-info: not spam, SpamAssassin (score=-5.0, required=12.0, autolearn=disabled, UIO_MAIL_IS_INTERNAL=-5) X-UiO-Scanned: E057503E075AC633FBD212DACAD205C097AAFE9D X-UiO-SPAM-Test: remote_host: 129.240.202.141 spam_score: -49 maxlevel 200 minaction 2 bait 0 mail/h: 1 total 22 max/h 3 blacklist 0 greylist 0 ratelimit 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/149 X-Sequence-Number: 28149 Karthikeyan Sundaram wrote: > Hi, > > I have written a plpgsql function media_format_func(p_in > overlay_format_type) which returns int > > $sql='select * from > media_format_func((200,400,'640*481','jpg')::overlay_format_type)'; > > $result = $this->objDB->query($sql); > print_r($result,1); > > I should get a value as 10, instead I am getting the Resource ID as > 128 which is wrong I guess I am getting the output as an object and I > am not getting the expected resul that I should get. Try one of the methods $this->objDB->getRow($sql), $this->objDB->getAll($sql) or $this->objDB->getOne($sql) instead. Also, have a look at the documentation at pear.php.net -- Tommy www.gildseth.com