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 ));