DB2 - wrong number of parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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???

thanks

Pablo Garay
Ijuí - UNIJUI
RS - Brasil


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux