Home > Backend Development > PHP Tutorial > Joomla database operation sample code

Joomla database operation sample code

WBOY
Release: 2016-07-29 09:07:34
Original
997 people have browsed it

The examples in this article describe the Joomla database operation method. Share it with everyone 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()

Copy after login

2, jModel

$this->_db->setQuery($query);
$this->_db->loadObject();
$this->_getList($query, 0, 0); 

Copy after login

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

Copy after login

I hope this article will help you design PHP programs based on joomla help.

The above introduces the Joomla database operation sample code, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template