zoukankan      html  css  js  c++  java
  • drupal7 常用的数据读取API

    简介:这是drupal7 常用的数据读取API的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

    class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=344743' scrolling='no'>
    // 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();

    爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

    http://biancheng.dnbcw.info/php/344743.html pageNo:4
  • 相关阅读:
    POJ 2175 Evacuation Plan 费用流 负圈定理
    POJ 2983 Is the Information Reliable? 差分约束
    codeforces 420B Online Meeting
    POJ 3181 Dollar Dayz DP
    POJ Ant Counting DP
    POJ 1742 Coins DP 01背包
    中国儒学史
    产品思维30讲
    Java多线程编程核心技术
    编写高质量代码:改善Java程序的151个建议
  • 原文地址:https://www.cnblogs.com/ooooo/p/2240611.html
Copyright © 2011-2022 走看看