var_dump and sizeof database entry?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

This is stumping me something awful. I have searched the archive of this mailing list and google and the php and mysql websites with everything i can think of.

I have a simple mysql table with some basic columns and a blob column that holds an image file. What I need to get is the size of this image file for use with an rss feed (the enclosure "length" parameter).

In the simplest case, I thought I would just read the entire blob into a variable, and then I would be able to get the size of this variable. However, php does not seem to have a function to do this. Inexplicably, the "var_dump" command will actually dump the information I want, but it is very memory inefficient, because I get something like:
["preview"]=> string(17888) "ENTIRE CONTENTS OF BLOB HERE"

where all I really want is the 17888 value (for a 17.5 KB file).

What I was wondering is if there is a simple way to get this information from mysql directly without having to 1) select the blob column and 2) do a var_dump with output buffering and parsing for the parenthetical file size, which seems very inefficient to me.

any insight is greatly appreciated.

Jordan

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux