retrive data from drupal not working
After some R&amp;D got the solution as follows:

$sql="select * from project_status where node_id=".$vid." and ".  strtolower($field_progress_flags)."!='' and ".  strtolower($field_progress_flags)." IS NOT NULL";    
$result = db_query($sql);
while($record = $result-&gt;fetchAssoc()){
        $data[]=$record;
}  


and its works for me