I am using this code to retrieve post meta:
<?php if( get_post_meta($post->ID,'a',true) == ''){
echo '<img src="' . get_bloginfo( 'template_url' ) . '/img/img22.jpg" ></img>';
}else{
echo get_post_meta($post->ID,'a',true);
} ?>
My first block of if statement is always executing no matter whether the mete box text field is empty or not and else block is not executing in any case. I want to know if there is any flaw in this code or
echo get_post_meta($post->ID,'a',true)
is not a valid code. Your help will be highly appreciated.

var_dump(get_post_meta($post->ID,'a',true))before the if, what do you get? – Miha Rekar Oct 9 '12 at 7:26a;) – Miha Rekar Oct 9 '12 at 8:13var_dump(get_post_meta($post->ID))and it will return all the meta values you have. – Miha Rekar Oct 9 '12 at 8:25