php - Getting image from mysql database -



php - Getting image from mysql database -

not sure happened, script working fine few days ago , i'm not sure have changed have messed up. pulling blob's database , displaying them. script is:

<?php include '../dbc.php'; $id = $_post['dropdown']; $query = sprintf('select * images image_id = %d', $id); $result = mysql_query($query); $image = mysql_fetch_array($result); header('content-type: ' . $image['mime_type']); header('content-length: ' . $image['file_size']); echo $image['file_data']; ?>

i dont think there wrong script because can echo out $id, $image['mime_type'], , $image['file_size'] fine. echoing $image['file_data'] gives me of symbols on screen lead me believe working fine. when run script get

the image "http://localhost/php/pop_category_viewimages.php" cannot displayed because contains errors

ive reached end of newbie debugging skills , stuck here. beingness on localhost there isn't much else me post here help on how debug help alot. not sure here. said worked fine must have switched somewhere throw off.

php mysql

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -