Edit

Template Coding Drupal Obtain matching entities

function obtain_entities_by_type($entity_type,$bundle,$limit=10,$offset=0,$subject_nid=FALSE){

    $query=new EntityFieldQuery();

    $query->entityCondition('entity_type', $entity_type)
        ->entityCondition('bundle', $bundle)
        ->propertyCondition('status', 1)
        ->range($offset, $limit);

    if($subject_nid)
        $query->fieldCondition('field_subject','nid',$subject_nid);

    $results=$query->execute();

    if(array_key_exists('node',$results))
        return entity_load($entity_type,array_keys($results[$entity_type]));

}

Useage

obtain_entities_by_type('node','page',10,0,432);

Or

<?php
$sql="SELECT node.nid AS nid,
node.title AS node_title,
node.created AS node_created,
node_data_field_weight.field_weight_value AS node_data_field_weight_field_weight_value
 FROM node node
 LEFT JOIN content_field_weight node_data_field_weight ON node.vid = node_data_field_weight.vid
 WHERE (node.status <> 0)
    ORDER BY node_data_field_weight_field_weight_value DESC";

$db_query=db_query($sql);

$items=array();
while($row=db_fetch_array($db_query))
	$items[]=array( $row["node_title"], $row["node_created"], $row["nid"], $row["node_data_field_weight_field_weight_value"] );

echo("<pre>".print_r($items,TRUE)."</pre>\n\n");

?>

Or

<?php
function snag_drupal_pages(){
    $sql_children="SELECT node.nid AS nid, node.vid AS node_vid, node.title AS node_title
     FROM node node
     WHERE node.type in ('page')";
    $db_query_children = db_query($sql_children);
    $pages=array();
    foreach($db_query_children as $row){
    	$nd=node_load($row->nid);
    	$key=array_push( $pages,array() ) - 1;
    	$pages[$key]["id"] = $row->nid;
    	$pages[$key]["title"] = $nd->title;
    	$pages[$key]["date"] = $nd->created;
    	if( drupal_lookup_path('alias',"node/".$nd->nid) ) $pages[$key]["path"] = drupal_lookup_path('alias',"node/".$nd->nid);
    	else $pages[$key]["path"] = "node/".$nd->nid;
    	if( !empty($nd->field_parent_page) ) $pages[$key]["group"] = $nd->field_parent_page["und"][0]["nid"];
    }
    #echo("<pre>");print_r($pages);echo("</pre>\n");
    return $pages;
}
?>