about 9 years ago
WE can easily manipulate our data from database in Joomla by using the below code. First need to call jfactory::getDBO$db = &JFactory::getDBO(); returns a reference for the database object in joomla.
For INSERT query in Joomla structure
- $db = &JFactory::getDBO();
- $insertquery = "INSERT into #__TABLENAME(feild1,feild2) values('value1','value2') ";
- $db->setQuery( $insertquery );
- $db->query();
$db = &JFactory::getDBO(); $insertquery = "INSERT into #__TABLENAME(feild1,feild2) values('value1','value2') "; $db->setQuery( $insertquery ); $db->query();
For UPDATE query in Joomla structure
For DELETE query in Joomla structure
0 Comment(s)