php - How to encode blob to base64 string on yii framework? -


i want encode blob image db base64 string, want encode string json. i've tried this:

$img = image::model()->findbysql('select img tbl_img id=1'); $value = chunk_split(base64_encode($img)); echo cjson::encode($value); 

the img field above blob. , i've got nothing. can help?

use

echo json_encode($value); 

instead of

echo cjson::encode($value); 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -