: This article mainly introduces the example code of joomla database operations. if you are interested in the PHP Tutorial, refer to it. This document describes how to operate the joomla database. We will share this with you for your reference. The details are as follows:
1. jTable
$ Row = & JTable: getInstance ('comment', 'table'); $ row-> load ($ id); $ row-> bind (JRequest :: get ('post') $ row-> store ()
2. jModel
$ This-> _ db-> setQuery ($ query); $ this-> _ db-> loadObject (); $ this-> _ getList ($ query, 0, 0 );
3. jFactory
$ Db = & JFactory: getDBO (); $ query = "SELECT count (*) FROM #__ reviews"; $ db-> setQuery ($ query ); $ total = $ db-> loadResult (); $ query = "SELECT * FROM #__ reviews"; $ db-> setQuery ($ query, $ limitstart, $ limit ); $ rows = $ db-> loadObjectList ();
I hope this article will help you design PHP programs based on joomla.
The above describes the sample code for operations on the joomla database, including the relevant content. if you are interested in the PHP Tutorial, please help.