How to get Node IDs of nodes whose titles contain a certain string?
You need iterate over the node collection, you can use this code to do so:

$sql = 'SELECT title FROM {node} WHERE title LIKE :title';
$result = db_query($sql, array(':title' =&gt; '%' . $term-&gt;name . '%'));

foreach($result as $node) {
    //dpm($node);
    //$node is your object
    echo $node-&gt;title . '&lt;br&gt;';
}


Edit: If you want only specifics content types use this:

$sql = "SELECT title FROM {node} WHERE title LIKE :title AND type = 'your_content_type'";