You are here: PHP crashed when I try use bind function in PDO on Oracle « PHP Programming Language « IT news, forums, messages
PHP crashed when I try use bind function in PDO on Oracle

Posted by DavidPL on 07/07/06 07:48

Hello,
I have some problem with bind method in PDO on Oracle with clob | long
column type.

I have table named TEST_TABLE where I have two columns: ID (int 10, 0)
and TEXT (varchar 4000 or long or clob).

When I try execute PHP code (based on example in manual):

<?php
$sql = 'SELECT id, text FROM test_table';
try
{
$stmt = $this->m_pdoConnection->prepare($sql);
$stmt->execute();

/* Bind by column number */
$stmt->bindColumn(1, $id);
$stmt->bindColumn(2, $text);

while ($row = $stmt->fetch(PDO::FETCH_BOUND))
{
$data = $id . "\t" . $text . "\t";
print $data;
}
}
catch (PDOException $e)
{
print $e->getMessage();
}
?>

When column TEXT type is varchar(4000) all works ok, but I can write
text only to 4000 chars.

When column type is long I have: "Warning: PDOStatement::fetch()
[function.fetch]: column 1 data was too large for buffer and was
truncated to fit it in ...skrypt.php... on line ...xxx...", and text in
$text is cut to 1000 chars, and...

When column type is clob PHP is crashed.

I have PHP 4.1.2 and Oracle 10g.

Please check this if You can.
Thanks

--
Dawid Szalega

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация