0

The manual says:

Likewise, binary columns will accept file handles, and generate file handles when reading data.

I'm seeing it do this. I have a table users with a column my_blob. I did the bake all, so now I have a Table Users with an Entity User. If I get $user then $user->my_blob is a file handle (or stream) resource, not a string or something I can access directly. Reading the data may be easy enough fread($user->my_blob, 256). But writing to it would be extremely cumbersome. I think I'd have to create a file to store my data then write to that or something like that.

How do I write to a BLOB field?

AD7six
  • 63,116
  • 12
  • 91
  • 123
Joe C
  • 2,728
  • 4
  • 30
  • 38
  • What are you trying to store? Actually I personally wouldn't probably store anything binary in a DB. See the answer here http://stackoverflow.com/questions/4450432/sql-server-how-to-store-binary-data-e-g-word-file – floriank Oct 01 '15 at 07:24
  • http://stackoverflow.com/a/32298752/1392379 – ndm Oct 01 '15 at 11:36
  • I just switched and used a text field instead. Still I think it would be useful to know how to store data in a blob field in CakePhP 3.0. – Joe C Oct 13 '15 at 15:11

0 Answers0