Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Re: Assigning Functions To Variables


Message #1 by George Herson <gherson@s...> on Mon, 01 Jan 2001 16:19:45 -0500
Maybe you want to try:

call_user_func - Call a user function given by the first parameter

Michael Blake wrote:

> Yes, I am using a class. A method within the calss connects to a database
> and I would like to use a variable (this->db_connect) that can point to
> either the mssql_connect() or mysql_connect() function.
>
> > Well, if you are using this ->, you are using classes.
> >
> > Adam Lang
> > Systems Engineer
> > Rutgers Casualty Insurance Company
> > http://www.rutgersinsurance.com
> > ----- Original Message -----
> > From: "Michael Blake" <mblake@r...>
> > To: "professional php" <pro_php@p...>
> > Sent: Wednesday, December 27, 2000 5:11 PM
> > Subject: [pro_php] Assigning Functions To Variables
> >
> >
> > > While viewing the example on page 140, I tried to set a variable:
> > > $this->db_connect = "mssql_connect"; I then called the function:
> > > $connection 
> > > $this->db_connect($this->servername,$this->username,$this->password); and
> > > php reports an unidentified function. Does this only work with function
> > > that are locally declared?
>
> ---


--- 
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development, 
Web Development, Networking & Communications, and Hardware & Systems.  
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to pro_php as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-pro_php-$subst('Recip.MemberIDChar')@p2p.wrox.com

  Return to Index