Tag Archives: sql

Joomla: Executing Sql Queries with JDatabase

1) Getting the default database connection: $db =& JFactory::getDBO(); 2) Set the query. Can pass in start and length LIMIT values to shrink the resultset. This will add LIMIT 0,3 to the end. $db->setQuery($query,0,3); 3) Execute the query. You can call various methods depending on what amount of data is being returned $db->loadObject() – returns […]