Tutorial by Examples

Ordering the results and setting a limit can easily be achieved with 2 additional lines added to the chain, like so: $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*') ->from('#__users') ->where('username = '. $db->q('John')) ->ord...
A simple query that selects all users from the #__users table with a username that matches John $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*'); $query->from('#__users'); $query->where('username = '. $db->q('John')); $db->setQuery($query); ...

Page 1 of 1