Re: [PHP] Variable number of parameters

2008-08-05 Thread Larry Garfield
On Tuesday 05 August 2008 12:40:27 am Philip Thompson wrote: > Ok, is it possible to send any number of variables to db->bind() in > order to send those to statement->bind_param()? > > Or, if someone else has a better db abstraction method, feel free to > educate... > > Thanks, > ~Phil Unless I'm

Re: [PHP] Variable number of parameters

2008-08-05 Thread Daniel Brown
On Tue, Aug 5, 2008 at 6:07 PM, Jim Lucas <[EMAIL PROTECTED]> wrote: > > # WARNING > # The following example uses eval() to do the execution. > # The following answer is a YMMV answer. > # Be careful with it. I could be a sleeping snake waiting to bite... > # Errata for those of

Re: [PHP] Variable number of parameters

2008-08-05 Thread Jim Lucas
Philip Thompson wrote: Is it possible to grab a variable number of parameters and send the appropriate amount to another function? db->prepare("SELECT * FROM `table` WHERE (`id`=?)"); $this->db->bind('ii', $id1); $this->db->prepare("SELECT * FROM `table` WHERE (`id`=? AND `other_id`=?)"); $t

Re: [PHP] Variable number of parameters

2008-08-05 Thread Per Jessen
Philip Thompson wrote: > This isn't exactly what I'm wanting to achieve. I don't want to send > each parameter individually, I want to send them all at the same time. Sounds like you want the standard varargs behaviour from C ? Where you can "gather up" a list of arguments as a va_list and pass t

Re: [PHP] Variable number of parameters

2008-08-05 Thread Philip Thompson
On Aug 5, 2008, at 10:34 AM, Igor Kolodziejczyk wrote: Philip Thompson wrote: On Aug 5, 2008, at 8:58 AM, Daniel Brown wrote: On Tue, Aug 5, 2008 at 1:40 AM, Philip Thompson <[EMAIL PROTECTED] > wrote: Is it possible to grab a variable number of parameters and send the appropriate amount to a

Re: [PHP] Variable number of parameters

2008-08-05 Thread Per Jessen
Philip Thompson wrote: >> but more likely, you're looking for func_get_args(). >> >>http://php.net/func_get_args > > Fortunately, I am quite familiar with your example. However, I am more > looking for something in which I could send any number of parameters > to my own function,

Re: [PHP] Variable number of parameters

2008-08-05 Thread Igor Kolodziejczyk
Philip Thompson wrote: On Aug 5, 2008, at 8:58 AM, Daniel Brown wrote: On Tue, Aug 5, 2008 at 1:40 AM, Philip Thompson <[EMAIL PROTECTED]> wrote: Is it possible to grab a variable number of parameters and send the appropriate amount to another function? You can predefine function paramete

Re: [PHP] Variable number of parameters

2008-08-05 Thread Philip Thompson
On Aug 5, 2008, at 8:58 AM, Daniel Brown wrote: On Tue, Aug 5, 2008 at 1:40 AM, Philip Thompson <[EMAIL PROTECTED] > wrote: Is it possible to grab a variable number of parameters and send the appropriate amount to another function? You can predefine function parameters: but more

Re: [PHP] Variable number of parameters

2008-08-05 Thread Daniel Brown
On Tue, Aug 5, 2008 at 1:40 AM, Philip Thompson <[EMAIL PROTECTED]> wrote: > Is it possible to grab a variable number of parameters and send the > appropriate amount to another function? You can predefine function parameters: but more likely, you're looking for func_get_args().

[PHP] Variable number of parameters

2008-08-04 Thread Philip Thompson
Is it possible to grab a variable number of parameters and send the appropriate amount to another function? db->prepare("SELECT * FROM `table` WHERE (`id`=?)"); $this->db->bind('ii', $id1); $this->db->prepare("SELECT * FROM `table` WHERE (`id`=? AND `other_id`=?)"); $this->db->bind('ii', $i