This article mainly introduces the joomla database operation methods, and analyzes the specific implementation methods of joomla for database connection and query operations, for more information about how to operate the joomla database, see the example in this article. 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.