Re: DB2 - wrong number of parameters

From: Date: Tue, 18 Jul 2006 00:06:27 +0000
Subject: Re: DB2 - wrong number of parameters
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-42220@lists.php.net to get a copy of this message
Pablo Garay wrote:
Hi! I´m working with PHP 5 and using the DB2 database. I´m trying to update a jpg file, that´s save on the database. here´s the code:
            $fp = @fopen("$caminho/$nome_arquivo", 'r');
        $content = fread($fp, filesize("$caminho/$nome_arquivo"));
        $content = bin2hex($content);
        fclose($fp);
                $conn = $this->DB2->getConn(); //get the connection id
    $q = "update dbsm.FUNCIONARIOS set FOTO=? where ID_FUNCIONARIO=?";
    $res = odbc_prepare ($conn, $q);
    $array = array();
    $array[0] = $content; //file
    $array[1] = $idFuncionario;
        $exc = odbc_execute($res, $array);
but when I run it, the folow warning appears: Warning: odbc_execute() [function.odbc-execute]: SQL error: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001, SQL state 07001 in SQLExecute in C:\Arquivos de programas\Apache Group\Apache2\htdocs\principal\Portal\Repositorio\Funcionarios.class.php on line 170 what´s the problem???
Looks like a bug to me. I found this one: http://bugs.php.net/bug.php?id=37646 which is kinda related. Search bugs.php.net and see if it has been reported. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#42220) next »