Showing posts with label problem with like query drupal6. Show all posts
Showing posts with label problem with like query drupal6. Show all posts

Wednesday, November 23, 2011

Usage of Like query in drupal6

You have to out two percentage between %s

$sql = "SELECT title FROM node WHERE type='%%%s' AND title LIKE '%%%S%%'";
$type = "type to use in query";
$title = "title to use in query";
$result = db_result(db_query($sql, $type, $title));