[UPHPU] PHP MySQLi bind_param arguments
Jacob Wright
jacwright at gmail.com
Sat Jan 20 08:22:16 MST 2007
Sorry, forgot to add the function defenition:
http://us3.php.net/manual/en/function.call-user-func-array.php
There are also several other very useful (in certain situations) functions
in that package.
Regards,
Jacob
On 1/20/07, Jacob Wright <jacwright at gmail.com> wrote:
>
> **this is the part that's thowing me***
> >
> > /*I need to now call $db->bind_param('ississ', $arg1, $arg2) dynamically
> > for
> > only those fields that are to be updated. I'm looking for a good way to
> > create $arg1, arg2 as necessary. I can create a single string easily
> > enough
> > from a dynamic array, but then there's a mismatch of types->arguments to
> >
> > replace.
> >
> > What I really need (I think) is an array_func ??? that will seperate the
> > array members into comma delimited string variable arguments (not a
> > single
> > string argument)*/
> >
> > Any ideas? And thanks!
>
>
>
> Are you looking for something like this?
>
> // add your string first
> $params = array('ississ');
>
> // add parameters as needed
> if ($arg1) $params[] = $arg1;
> if ($arg2) $params[] = $arg2;
>
> // make the call with the parameters (for object methds you pass in an
> array of [object, method] to make the call)
> *call_user_func_array* (array($db, "bind_param"), $params);
>
>
>
> --
> Jacob Wright
> Within Code LLC
>
--
Jacob Wright
Within Code LLC
More information about the UPHPU
mailing list