db_query for a specific titles I'm building a custom module for webform and I want to get only a title for a specific content type.

In phpMyAdmin with sql query I've managed to sort what titles I need. This is the SQL query:

SELECT title FROM `node` WHERE TYPE = 'outlets' AND uid


How can I wrap this into db_query() ?
You can read more about db_query() here.

$result = db_query("
  SELECT title
  FROM {node} n
  WHERE n.type = :type
    AND n.uid =:uid
", array(':type' =&gt; 'outlets', ':uid' =&gt; $uid));

foreach ($result as $record) {
  // Perform operations on $record-&gt;title, etc. here.
  // in this example the available data would be mapped to object properties:
  // $record-&gt;nid, $record-&gt;title, $record-&gt;created
}