Re: Calling a stored procedure

From: Date: Fri, 30 Nov 2007 18:50:01 +0000
Subject: Re: Calling a stored procedure
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-265308@lists.php.net to get a copy of this message
On Nov 30, 2007 1:39 PM, Dan Shirah <mrsquash2@gmail.com> 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.

« previous php.general (#265308) next »