本文整理汇总了PHP中Connection::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Connection::select方法的具体用法?PHP Connection::select怎么用?PHP Connection::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connection
的用法示例。
在下文中一共展示了Connection::select方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Connection
}
?>
</select>
<input type='submit' name='Ajouter' value='Supprimer cette catégorie' />
</fieldset>
</form>
<h2>Supprimer un document</h2>
<form action='index.php' method='POST'>
<fieldset>
<input type='hidden' name='action' value='untrain'/>
Document à supprimer :
<select name='docid'>
<?php
$con = new Connection($login, $pass, $server, $db);
$rs = $con->select("SELECT * FROM nb_references");
while (!$rs->EOF()) {
echo "<option value='" . $rs->f('id') . "'>" . $rs->f('id') . " - " . $rs->f('category_id') . "</option>\n";
$rs->moveNext();
}
?>
</select>
<input type='submit' name='Ajouter' value='Supprimer ce document' />
</fieldset>
</form>
<pre>
This file is part of PHP Naive Bayesian Filter.
The Initial Developer of the Original Code is
Loic d'Anterroches [loic xhtml.net].
示例2: toFluent
/**
* Returns this data source wrapped in Fluent object.
* @return Fluent
*/
public function toFluent()
{
return $this->connection->select('*')->from('(%SQL) t', $this->__toString());
}
示例3: getMemberships
/**
* Return the groups the given user is a member of
*
* @param User $user
*
* @return array
*/
public function getMemberships(User $user)
{
$userQuery = $this->ds->select()->from($this->userClass)->where($this->userNameAttribute, $user->getUsername())->setBase($this->userBaseDn)->setUsePagedResults(false);
if ($this->userFilter) {
$userQuery->where(new Expression($this->userFilter));
}
if (($userDn = $userQuery->fetchDn()) === null) {
return array();
}
$groupQuery = $this->ds->select()->from($this->groupClass, array($this->groupNameAttribute))->where($this->groupMemberAttribute, $userDn)->setBase($this->groupBaseDn);
if ($this->groupFilter) {
$groupQuery->where(new Expression($this->groupFilter));
}
$groups = array();
foreach ($groupQuery as $row) {
$groups[] = $row->{$this->groupNameAttribute};
}
return $groups;
}
示例4: Connection
<div class="content_section_data">
<form name="frmspamdocremove" method='POST'>
<table align="left" class="comm_tbl ">
<tr>
<td align="left">
<input type='hidden' name='action' value='untrain' />
<?php
echo TEXT_EDIT_SPAM_DOCUMENT_REMOVE_TEXT2;
?>
:
<select name='docid' class="comm_input input_width1a">
<?php
$con = new Connection($login, $pass, $server, $db);
$rs = $con->select("SELECT * FROM sptbl_spam_references");
while (!$rs->EOF()) {
echo "<option value='" . $rs->f('id') . "'>" . $rs->f('id') . " - " . $rs->f('category_id') . "</option>\n";
$rs->moveNext();
}
?>
</select>
</td><td align="left">
<input type='submit' name='Submit' value='<?php
echo TEXT_EDIT_SPAM_DOCUMENT_REMOVE;
?>
' class="comm_btn" />
</td>
</tr>
</table>
示例5: getMemberships
/**
* Return the groups the given user is a member of
*
* @param User $user
*
* @return array
*/
public function getMemberships(User $user)
{
if ($this->groupClass === 'posixGroup') {
// Posix group only uses simple user name
$userDn = $user->getUsername();
} else {
// LDAP groups use the complete DN
if (($userDn = $user->getAdditional('ldap_dn')) === null) {
$userQuery = $this->ds->select()->from($this->userClass)->where($this->userNameAttribute, $user->getUsername())->setBase($this->userBaseDn)->setUsePagedResults(false);
if ($this->userFilter) {
$userQuery->where(new Expression($this->userFilter));
}
if (($userDn = $userQuery->fetchDn()) === null) {
return array();
}
}
}
$groupQuery = $this->ds->select()->from($this->groupClass, array($this->groupNameAttribute))->where($this->groupMemberAttribute, $userDn)->setBase($this->groupBaseDn);
if ($this->groupFilter) {
$groupQuery->where(new Expression($this->groupFilter));
}
Logger::debug('Fetching groups for user %s using filter %s.', $user->getUsername(), $groupQuery->__toString());
$groups = array();
foreach ($groupQuery as $row) {
$groups[] = $row->{$this->groupNameAttribute};
}
Logger::debug('Fetched %d groups: %s.', count($groups), join(', ', $groups));
return $groups;
}