if(empty($image)) { $pic = 'types/'.$vid.'.gif'; } else { $pic = 'equipment/'.$image.'.jpg'; } echo '<img src="img/'.$pic.'">';