You are here

function amazon_item_node_delete in Amazon Product Advertisement API 6

1 call to amazon_item_node_delete()
amazon_item_node_save in ./amazon.module
Utility functions for managing AmazonItem/Node relationships

File

./amazon.module, line 695

Code

function amazon_item_node_delete($asin = NULL, $nid = NULL, $module = NULL) {
  $sql = "DELETE FROM {amazon_item_node} WHERE 1 = 1";
  $params = array();
  if (isset($asin)) {
    $sql = " AND asin = '%s'";
    $params[] = $asin;
  }
  if (isset($nid)) {
    $sql = " AND nid = %d";
    $params[] = $nid;
  }
  if (isset($module)) {
    $sql = " AND module = '%s'";
    $params[] = $module;
  }
  if (count($params)) {
    db_query($sql, $params);
  }
}