RE: Calling a stored procedure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Dan Shirah [mailto:mrsquash2@xxxxxxxxx]
> Sent: Friday, November 30, 2007 4:00 PM
> To: Daniel Brown
> Cc: php-general
> Subject: Re:  Calling a stored procedure
> 
> I tried a different approach with the code below:
> 
> if ($num_rows > 0 && $barcode_id == "") {
>  echo "The query found ".$num_rows." row(s)";
>  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> '$event_date',
> '$event_sequence', '$event_code')";
>  $call_result = ifx_query($connect_id, $call_procedure);
>  }
> 
> And I get the error: PHP Warning: ifx_query(): supplied argument is not
> a
> valid Informix link resource
> 
> I don't know if this is a step in the right direction or not.
> 
> 
> On 11/30/07, Dan Shirah <mrsquash2@xxxxxxxxx> wrote:
> >
> > I'm not sure if we're on the same page.
> >
> > I have a stored procedure on my Informix server. All I am trying to
> do is
> > create a simple form that when submitted will pass several parameters
> to the
> > stored procedure and execute it.
> >
> > I shouldn't have to pass the head/body/content to the Informix server
> to
> > execute the procedure, right?
> >
> >
> >  On 11/30/07, Daniel Brown <parasane@xxxxxxxxx> wrote:
> > >
> > > On Nov 30, 2007 1:39 PM, Dan Shirah <mrsquash2@xxxxxxxxx> wrote:
> > > > Hello all,
> > > >
> > > > I am having soem difficulty when trying to call an INFORMIX
> stored
> > > procedure
> > > > with PHP.
> > > >
> > > > I have verified that the if() condition is true and all of the
> > > parameters I
> > > > am passing are valid. However, when I run the following:
> > > >
> > > > if ($num_rows > 0 && $barcode_id == "") {
> > > >  echo "The query found ".$num_rows." row(s)";
> > > >  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> > > '$event_date',
> > > > '$event_sequence', '$event_code')";
> > > >  $call_result = $connect_id->query($call_procedure);
> > > >  }
> > > >
> > > > I get this error message: PHP Fatal error: Call to a member
> function
> > > query()
> > > > on a non-object
> > > >
> > > > I have never tried to call a stored procedure in PHP before so
> I'm not
> > > even
> > > > sure if I am on the right track.
> > > >
> > > > Any help is greatly appreciated.
> > > >
> > > > Dan
> > > >
> > >
> > >    You have to first instantiate the class.
> > >
> > >    For example:
> > >
> > > <?
> > > include_once("classes/layout.class.php");
> > > $H = new Head();
> > > $B = new Body();
> > > $P = new Page($H, $B);
> > > $H->title("A Sample PHP Page");
> > > $H->css("sample.css");
> > > $B->content("This is where Dan Shirah's content would go.");
> > > $P->render();
> > > ?>
> > >
> > > --
> > > Daniel P. Brown
> > > [office] (570-) 587-7080 Ext. 272
> > > [mobile] (570-) 766-8107
> > >
> > > If at first you don't succeed, stick to what you know best so that
> you
> > > can make enough money to pay someone else to do it for you.
> > >
> >
> >

The order of parameters is reverted. Try:

$call_result = ifx_query($call_procedure, $connect_id);

... and RTFM http://php.net/manual/en/function.ifx-query.php

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
| TEL 954-607-4207 | FAX 954-337-2695
Email: info@xxxxxxxxxxxxx  | MSN Chat: best@xxxxxxxxxxxxx  |  SKYPE:
bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-diy.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux