Mysql
 sql >> Database >  >> RDS >> Mysql

Come ottenere la dimensione del BLOB in PHP o SQL

In SQL:

SELECT some_key, LENGTH(blob_column) AS size_in_bytes FROM the_table

In PHP:

$sizes = array();
foreach (how_you_query_the_db('SELECT some_key, blob_column FROM the_table ') as $row)
  $sizes[$row['some_key']] = strlen($row['blob_column']);