How to write database statements in discuz

Source: Internet
Author: User
In discuz, how to write the database sentence book is finally edited by ziluopao3 at 2014-09-2514: 54: 50. for example, I want to take the values of all fields in the portal_category table C :: t (portal_category)-& gt; fetch ........................ & nbsp; how to write database statements in discuz

This post was last edited by ziluopao3 at 14:54:50

For example, I want to take the values of all fields in the portal_category table.
C: t ('Portal _ category ')-> fetch ........................ what should I do later?
------ Solution ----------------------
C: t ('Portal _ category ')-> fetch ($ id); // $ id is the primary key
You can view all encapsulated table models in the/source/class/table/directory.
You can also use the DB class to operate the database (the bottom layer of the table model uses DB Class operations)
$ Res = DB: fetch_first ('select * from % t where catid = % d', array ('Portal _ category ', 1 ));

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.