Showing posts with label PHP Source Code. Show all posts
Showing posts with label PHP Source Code. Show all posts

Tuesday, November 4, 2008

PHP Source Code »Using Large Objects in OCI8

In PHP
, LOBs are manipulated using a descriptor. To show this, in SQL*Plus create a table
that has a BLOB column:
SQL> create table mybtab (blobid number, blobdata blob);
PHP code
to insert data into this table is:
navioo_blobinsert.php

$c = oci_connect('hr', 'hrpwd', '//localhost/XE');
$myblobid = 123;
$myv = 'a very large amount of binary data';
$lob = oci_new_descriptor($c, OCI_B_LOB);
$s = oci_parse($c,
'INSERT INTO mybtab (blobid, blobdata) '
. 'VALUES(:myblobid, EMPTY_BLOB()) '
. 'RETURNING blobdata INTO :blobdata');
oci_bind_by_name($s, ':MYBLOBID', $myblobid);
oci_bind_by_name($s, ':BLOBDATA', $lob, -1, OCI_B_BLOB);
oci_execute($s, OCI_DEFAULT);
$lob->save($myv);
oci_commit($c);
?>


Read all..

Tuesday, October 28, 2008

One of the main key features of HttpResponse is HTTP caching

One of the main key features of HttpResponse is HTTP caching. HttpResponse will calculate an ETag based on the http.etag_mode INI setting as well as it will determine the last modification time of the sent entity. It uses those two indicators to decide if the cache entry on the client side is still valid and will emit an "304 Not Modified" response if applicable.




    


HttpResponse
::setCacheControl('public');    

HttpResponse::setCache(true);    

HttpResponse::capture();    

    

print 
"This will be cached until content changes!\n";    

print 
"Note that this approach will only save the clients download time.\n";    

?>    

    


More Examples PHP class HttpResponse