Subject Re: [firebird-php] ibase_execute arguments, HELP
Author Jochem Maas
Lester Caine wrote:
> Thomas Beckmann wrote:
>
>
>>Hi Erik,
>>
>>this line leads to your problem:
>> > $obj = ibase_execute($prep, $arrValues['Value']) or $error = 1;
>>you can't do it with an array, at least not, if I understand the manual...

when one reads deeper .... ;-) ....

$obj = call_user_func_array('ibase_execute', array_unshift($prep, $arrValues['Value'])) or $error = 1;

>>
>>Except using
>>eval('$obj = ibase_execute($prep, '.join (',', $arrValues['Value']).')
>>or $error = 1;')
>>[just out of memory, completly untestet], I've no good idea.
>
>
> Good point Thomas - I get too used to ADOdb unpacking things for me :)

for unpacking I have a func (method) like so:

/* public static */ function resolveArgs($args)
{
$args = array_values($args);

for ($i = 0; $i < count($args); ++$i) {
// the 'while' used to be an 'if'
while (isset($args[$i]) && is_array($args[$i])) {
array_splice($args,$i,1,array_values($args[$i]));
}
}
/*
// this is not relevant if you dont use my Blob class!
for ($i = 0; $i < count($args); ++$i) {
if ($args[$i] instanceof Blob) {
$args[$i] = $args[$i]->blobId;
}
}
//*/
return $args;
}

>