Subject Re: [firebird-php] ibase_execute arguments, HELP
Author Thomas Beckmann
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...

Except using
eval('$obj = ibase_execute($prep, '.join (',', $arrValues['Value']).')
or $error = 1;')
[just out of memory, completly untestet], I've no good idea.


Erik Raul Chan Silveira schrieb:
> Hello People, Good Morning (afternoon or night):
>
> Im trying to do a script for importing text data to any table in a FB
> DB.
>
> I create the INSERT statement by reading table name & fields names,
> something
> like:
>
> ....
> $statement = 'INSERT INTO TableA (Field1, Field2, Field3) VALUES
> (?, ?, ?)';
> (this is the easy part), then:
>
> ....
> $stmt = $statement;
> $trans =ibase_trans();
> $prep = ibase_prepare($stmt) or die("Incorrect stmt ...");
>
> while(!feof($file)) {
> $line = trim(fgets($file, 1024));
> $arrValues = array();
>
> /*process to obtain the values from the line....*/
> $arrValues['Value'][] = 'XXX ';
> ...
> $arrValues['Value'][] = '100.00';
> .....
> $arrValues['Value'][] = 'ZZZZ';
> /*at the end of this process i have a array with the values for
> the fields*/
>
> $obj = ibase_execute($prep, $arrValues['Value']) or $error = 1;
> if($error == 1){
> echo "\n" .print_r($arrValores);
> }
>
> } //while
> fclose($file);
> ibase_commit($trans);
> ibase_free_query($prep);
>
> The error Im obtaining is "function.ibase-execute: statement expects
> 3 arguments, 1 given in ..."
> (Of course the number 3 is depending on the table in process.)
>
> Is there a way to doit with arrays or how can I accomplish it ?
>
> Please, help me. Im very new to PHP.
>
> Thanks in advance,
>
> _______
> Erik Raul
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>


--
Thomas.Beckmann@...
Martens & Prahl EDV, Wielandstr. 14c, 23558 Lübeck
Telefon 0451-39904-525 • Telefax -559