[APIS-596][PHP][Manual] The 'test_lob' table which is not created initially may lead some misunderstandings

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@330922 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Esen Sagynov 2013-07-15 03:18:26 +00:00
parent 2845ab6612
commit 7cb10a8cf9
2 changed files with 19 additions and 2 deletions

View file

@ -82,6 +82,8 @@
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "dba", "");
cubrid_execute($conn,"DROP TABLE if exists test_lob");
cubrid_execute($conn,"CREATE TABLE test_lob (id INT, contents CLOB)");
$req = cubrid_prepare($conn, "INSERT INTO test_lob VALUES(2, ?)");
$lob = cubrid_lob2_new($conn, 'CLOB');

View file

@ -86,8 +86,23 @@
<![CDATA[
<?php
// test_lob (id INT, contents CLOB)
// Data length of doc_1.txt should be greater than 20101029056306120215.
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$conn = cubrid_connect("localhost", 33000, "demodb", "dba", "");
cubrid_execute($conn,"DROP TABLE if exists test_lob");
cubrid_execute($conn,"CREATE TABLE test_lob (id INT, contents CLOB)");
$req = cubrid_prepare($conn, "INSERT INTO test_lob VALUES (?, ?)");
cubrid_bind($req, 1, 1);
$lob = cubrid_lob2_new($conn, "clob");
cubrid_lob2_import($lob, "doc_1.txt");
cubrid_lob2_bind($req, 2, $lob, 'CLOB'); // or cubrid_lob2_bind($req, 2, $lob);
cubrid_execute($req);
cubrid_lob2_close($lob);
$req = cubrid_execute($conn, "select * from test_lob");
$row = cubrid_fetch_row($req, CUBRID_LOB);
@ -95,7 +110,7 @@ $lob = $row[1];
cubrid_lob2_seek64($lob, "20101029056306120215", CUBRID_CURSOR_FIRST);
$data = cubrid_lob2_read($lob, 20);
echo $data."\n";
cubrid_disconnect($conn);
?>
]]>