I have written a query which gets the node title according to 'term ID' for a 'portfolio' content type.Now I want to get the 'node title' according to the character that means I want to use 'LIKE' clause on the following query.If user enter "a" or "A" then all the node tile from these characters should be fetch.
<?php
$nodes = array();
$select = db_query("SELECT node.title AS node_title, node.nid AS nid, node.created AS node_created
FROM {node} node
WHERE node.status = '1'
AND node.type = 'portfolio'
AND node.nid IN (SELECT tn.nid AS nid
FROM {taxonomy_index} tn
WHERE tn.tid = '1')
ORDER BY node_created");
foreach ($select as $nodes) {
print $nodes->node_title;
}
?>