Difference between revisions of "JTableSession/exists"
From Joomla! Documentation
< API15:JTableSession
(New page: ===Description===
Find out if a user has a one or more active sessions
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JTableSession/exists|Edit Desc...) |
m (preparing for archive only) |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Syntax=== | ===Syntax=== | ||
Line 48: | Line 48: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Examples=== | ===Examples=== | ||
− | + | === Code Examples === | |
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=exists | category=exists | ||
category=JTableSession | category=JTableSession | ||
− | + | namespace=CodeExample | |
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API15]] |
Latest revision as of 20:12, 24 March 2017
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Find out if a user has a one or more active sessions
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
exists($userid)
Parameter Name | Default Value | Description |
---|---|---|
$userid | $userid The identifier of the user |
Returns[edit]
boolean True if a session for this user exists
Defined in[edit]
libraries/joomla/database/table/session.php
Importing[edit]
jimport( 'joomla.database.table.session' );
Source Body[edit]
function exists($userid)
{
$query = 'SELECT COUNT(userid) FROM #__session'
. ' WHERE userid = '. $this->_db->Quote( $userid );
$this->_db->setQuery( $query );
if ( !$result = $this->_db->loadResult() ) {
$this->setError($this->_db->stderr());
return false;
}
return (boolean) $result;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]