How to get Node Title and description when nid is avaiable? In Drupal 7 I am using following code in Global: PHP.

$data = message_load($row-&gt;mid);

if (isset($data-&gt;field_related_flag)){
  $fid = $data-&gt;field_related_flag['und'][0]['target_id'];
  $ftype = $data-&gt;field_flagged_node_type['und'][0]['value'];
  $flag = db_query('SELECT f.entity_id content_id, f.fid flag_id, flag.title type FROM flagging f INNER JOIN flag ON flag.fid = f.fid WHERE flagging_id = :val_fid', array(':val_fid' =&gt; $fid))-&gt; fetchAssoc();
  $flag['content_type'] = $ftype;
  return json_encode($flag);
}


And from this code, I get the following output:

'related_flag' =&gt; '{"content_id":"410","flag_id":"1","type":"like","content_type":"event"}',


Here "content_id":"410" is the node ID.

Now I need to get the node title, description, and other fields. Can anyone please tell me what code I should write to get the desired result?
You can easily load the node using $node = node_load($nid);

Hoever it can be a bit tricky to get the values you want, so I recommend Entity metadata wrappers. They are part of the Entity API module and they allow you to access node variables like this:

$node = node_load($nid);
$node_wrapper = entity_metadata_wrapper('node', $node);
$node_wrapper-&gt;title-&gt;value();
$node_wrapper-&gt;field_description-&gt;value(); 


At the bottom of the linked Entity metadata wrapper page is a section on Debugging or introspecting wrappers, you can use that to find all available fields and their names.