1. when writing data using the PDO preprocessing method, PDO defaults to the string type if bindParam () is used without specifying the Data Type of the field or execute, the default length is limited. Therefore, bindParam () or bindValue () must be used to store clob fields and specify the string length. For example
1. when writing data using the PDO preprocessing method, PDO defaults to the string type if bindParam () is used without specifying the Data Type of the field or execute, the default length is limited. Therefore, bindParam () or bindValue () must be used to store clob fields and specify the string length. For example
1. Write Data
When PDO preprocessing is used, if bindParam () is used without specifying the Data Type of the field or execute (), PDO defaults to the string type and limits a default length.
Therefore, bindParam () or bindValue () must be used to store clob fields and specify the string length, for example, $ pdo-> bindParam (': clobdata', $ clobData, PDO:: PARAM_STR, strlen ($ clobData ));
2. Read data
The CLOB field value retrieved by PDO is a resource identifier when this field is not empty. If it is null, It is a Null String. The data retrieval method is as follows:
$ Arr = $ pdo-> fetch ();
Is_resource ($ arr ['clob']) & $ arr ['clob'] = stream_get_contents ($ arr ['clob']);