$db
= JFactory::getDBO();
$query
=
$db
->getQuery(true);
$query
->select(
'contact.user_id, MAX(contact.id) AS id, contact.language'
);
$query
->from(
'#__contact_details AS contact'
);
$query
->where(
'contact.published = 1'
);
$query
->group(
'contact.user_id, contact.language'
);
$query
->order(
'contact.ordering'
);
$db
->setQuery(
$query
);
$rows
=
$db
->loadObjectList();
$db
= JFactory::getDbo();
$sql
=
'SELECT * FROM #__users WHERE state=1'
;
$db
->setQuery(
$sql
);
$rows
=
$db
->loadObjectList();
foreach
(
$rows
as
$row
) {
echo
$row
->name;
echo
$row
->email;
}
$db
= JFactory::getDbo();
$sql
=
'SELECT id FROM #__users WHERE state=1'
;
$db
->setQuery(
$sql
);
$userIds
=
$db
->loadResultArray();
echo
implode(
', '
,
$userIds
);
$db
= JFactory::getDbo();
$title
=
'????'
;
$sql
=
'UPDATE #__content SET title='
.
$db
->Quote(
$title
).
' WHERE id=1'
;
$db
->setQuery(
$sql
);
$db
->query();
$user
=
new
JUser();
$user
->load(
$this
->userId);
$user
->name =
'newname'
;
$user
->save();
$table
= JTable::getInstance(
'mytable'
);
$table
->load(
$id
);
$params
=
new
JParameter(
$table
->params);
$params
->set(
$key
,
$value
);
$table
->params =
$params
->toString();
$table
->store();
$table
= JTable::getInstance(
'mytable'
,
'XxxTable'
);
$table
->load(
$id
);
$table
->title =
'???'
;
$table
->store();
$table
=
$this
->getTable(
'mytable'
,
'XxxTable'
);
$table
->load(
$id
);
$articleParams
=
new
JRegistry;
$articleParams
->loadString(
$item
->attribs);
$item
->alternative_readmore =
$articleParams
->get(
'alternative_readmore'
);
$table
= JTable::getInstance(
'mytable'
);
$table
->load(
$id
);
$articleParams
=
new
JRegistry;
$table
->attribs =
$articleParams
->toString();
$table
->store();
$model
= JModel::getInstance(
'Articles'
,
'ContentModel'
);
$model
->setState(
'filter.state'
, 1);
$model
->setState(
'list.ordering'
,
'publish_up'
);
$items
=
$model
->getItems();