PHP handles Oracle's CLOB instances, Oracleclob instances
This paper gives a brief description of how PHP handles Oracle's CLOB. Share to everyone for your reference. Here's how:
1. Writing data
When using the PDO preprocessing method, if you use Bindparam () and so on without specifying the data type of the field or using Execute (), PDO defaults to the string type and limits a default length
Therefore, you must use Bindparam () or bindvalue (), etc. when you save the Clob type field, and specify the string length, for example:
Copy the code as follows: $pdo, Bindparam (': Clobdata ', $clobData, PDO::P Aram_str,strlen ($clobData));
2. Reading data
The Clob field value that PDO takes out is a resource identifier when the field is not empty, and an empty string for the data method as follows
Copy the code as follows: $arr = Fetch ($PDO);
Is_resource ($arr [' Clob ']) && $arr [' Clob '] =stream_get_contents ($arr [' Clob ']);
I hope this article is helpful to everyone's PHP programming.
PHP operation Oracle CLOB Type, why always prompt error
Man, I also have this problem ah, with the solution, resolved to say AH
How PHP reads the CLOB field
Write Data
When using the PDO preprocessing method, if you use Bindparam () and so on without specifying the data type of the field or using Execute (), PDO defaults to the string type and limits a default length
So you must use Bindparam () or bindvalue () and so on when you save the Clob type field, and specify the string length, for example, $pdo bindparam (': Clobdata ', $clobData, PDO::P aram_str, Strlen ($clobData));
Reading data
The Clob field value that PDO takes out is a resource identifier when the field is not empty, and an empty string for the data method as follows
$arr = Fetch () $pdo;
Is_resource ($arr [' Clob ']) && $arr [' Clob '] =stream_get_contents ($arr [' Clob ']);
I hope I can help you.
http://www.bkjia.com/PHPjc/904919.html www.bkjia.com true http://www.bkjia.com/PHPjc/904919.html techarticle PHP handles Oracle's CLOB instances, Oracleclob examples This article outlines PHP's approach to handling Oracle's CLOB. Share to everyone for your reference. The method is as follows: 1. Write data in use ...