How to fetch image from database in drupal Let me know how to fetch image from database. actually i am trying to fetch image from database using this question.
I am try to fetch image from database using following code.
$fid is my $row['column_name'] 

 $fid=$r['field_upload_photo_fid'];
 $image = theme('image_style', array(
'style_name'=&gt; 'small', 
'path' =&gt; $file-&gt;uri, 
'alt' =&gt; 'user picture'
 ));
 print $image;


Actual file url is http://example.com/sites/default/files/styles/Style_name/public/Chrysanthemum.jpg

but now it shows http://example.com/sites/default/files/styles/small/public/styles/Style_name/public/Chrysanthemum.jpg.
 thats why image not fetching from database.

Also what is a style in $variable.
The style is an image style which is described a bit in Working with images in Drupal 7 and 8. I believe that you need to use Style_name as the 'style' in your code instead of 'public':

 $fid=$r['field_upload_photo_fid'];
 $file = file_load($fid);
 $variables = array(
 'path' =&gt; $file-&gt;uri,
 'style'=&gt;'Style_name'
 );
 print theme('image_style', $variables);


But also, what is the data in $file-&gt;uri? If you start with bad data then the result is also going to be bad.