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/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php