Common Data Reading APIs of drupal7

Source: Internet
Author: User

Introduction: This is a detailed page of drupal7's Common Data Reading API. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 344743 'rolling = '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 ('subobject', '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 ();

Love J2EE follow Java Michael Jackson video station JSON online tools

http://biancheng.dnbcw.info/php/344743.html pageno: 4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.