PHP - If a field has a certain text value then print something
There's no syntax error in the second code sample, if you're getting a syntax error it's not coming from those lines.

The best way to get values from an entity is with field_get_items():

$items = field_get_items('node', $node, 'field_room');
if (count($items) &amp;&amp; check_plain($items[0]['value']) == 'Value1') {
  // Do something
}


But unless you have some sort of multi-lingual issue the code you've got should do exactly the same thing as that, so the problem might be elsewhere.