I need to insert a multiline text data to Blob type column.
My table is:
CREATE TABLE `messages` (
`id` int(11) NOT NULL,
`msg` longblob NOT NULL
);
Addionally I post this text for saving into 'msg' column:
"This
is
Multiline
Text"
Inserting part is;
$mydata->mesaj = "This
is
Multiline
Text";
$sql = "insert into messages(msg) values (:mesaj)";
$stmt = $this->dbConnection->prepare($sql);
$stmt->bindParam(':mesaj', $mydata->mesaj, PDO::PARAM_STR); /* Is it true for use PARAM_STR for longBlob type? */
try {
$stmt->execute();
} catch (PDOException $e) {
//..blah error blah
}
It does insert the text with out newlines. When i try to open blob record, it shows:
ThisisMultilineText
I try replace with . Unfortunetely It was another unsuccesfull attempt too. Need an idea. i need to save with multiline text. Thank you, Deniz