<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_execute($conn, "select * from test_lob");
$row = cubrid_fetch_row($req, CUBRID_LOB);
print "position now is " . cubrid_lob2_tell($row[1]) . "\n";
cubrid_lob2_seek($row[1], 10, CUBRID_CURSOR_FIRST);
print "\nposition after moving farword is " . cubrid_lob2_tell($row[1]) . "\n";
$data = cubrid_lob2_read($row[1], 12);
print "\nposition after reading is " . cubrid_lob2_tell($row[1]) . "\n";
print $data . "\n";
cubrid_lob2_seek($row[1], 5, CUBRID_CURSOR_CURRENT);
print "\nposition after moving again is " . cubrid_lob2_tell($row[1]) . "\n";
$data = cubrid_lob2_read($row[1], 20);
print $data . "\n";
cubrid_disconnect($conn);
?>