drupal7 常用的数据读取API
2012-10-19 13:08
387 查看
// node node_load($nid = NULL, $vid = NULL, $reset = FALSE); node_load_multiple($nids = array(), $conditions = array(), $reset = FALSE); // user user_load($uid, $reset = FALSE); user_load_multiple($uids = array(), $conditions = array(), $reset = FALSE); // menu tree menu_tree_all_data($menu_name, $link = NULL, $max_depth = NULL); menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail = FALSE); // term taxonomy_term_load($tid) : object taxonomy_term_load_multiple($tids = array(), $conditions = array()) : array taxonomy_get_tree($vid, $parent = 0, $max_depth = NULL, $load_entities = FALSE) : array // block block_load($module, $delta); // Pager db_select('node', 'n') ->extend('PagerDefault')->limit(5) ->fields('n'); ->fetchField(); db_query_range('SELECT n.nid, n.title, n.created FROM {node} n WHERE n.uid = :uid', 0, 10, array(':uid' => $uid)); $fields = array('nid' => 1, 'title' => 'my title', 'body' => 'my body'); db_insert('node')->fields($fields)->execute(); db_update('example') ->condition('id', $id) ->fields(array('field2' => 10)) ->execute(); // select $query = db_select('comment', 'c') ->fields('c', array('subject', 'name')) ->fields('n', array('title')) ->extend('PagerDefault')->limit(5) ->condition('n.type', array('article'), 'IN') ->orderBy('c.cid', 'DESC'); $query->join('node', 'n', 'n.nid = c.nid'); $data = $query->execute();
相关文章推荐
- drupal7 常用的数据读取API (转)
- drupal7 常用的数据读取API
- drupal7 常用的数据读取API
- Drupal7 常用的数据读写API
- 读取数据的常用方法
- POI实战-java开发excel详解之常用操作-单元格合并与数据读取
- HBase-scan API 通过scan读取表中数据
- ASP.NET中Gridview读取数据表列表页面常用操作-序号,编辑,删除,删除确认
- 使用FileSystem API读取数据
- 16-02-常用对象API(基本数据类型对象包装类-字符串转成基本数值)
- NoSQL初探之人人都爱Redis:(2)Redis API与常用数据类型简介
- Objective-C中基本数据烦类型与对象数据类型相互转换的方法(OC中NSString的常用API的基础应用3)
- ASP.NET中Gridview读取数据表列表页面常用操作-序号,编辑,删除,删除确认
- Hadoop FileSystem API读取数据实例简单注释
- 16-01-常用对象API(基本数据类型对象包装类-概述)
- Java笔记九.常用APIの数据类型包装类
- TensorFlow全新的数据读取方式:Dataset API——tf.data.Dataset
- POI实战-java开发excel详解(第四章 常用操作-单元格合并与数据读取)
- V4L2 API详解 <三> Buffer的准备和数据读取
- TensorFlow全新的数据读取方式:Dataset API入门教程