本文整理汇总了PHP中getTable函数的典型用法代码示例。如果您正苦于以下问题:PHP getTable函数的具体用法?PHP getTable怎么用?PHP getTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getTable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: relatedTags
function relatedTags($tags)
{
/* related tags */
$twhere = "";
foreach ($tags as $tag) {
$tag = rss_real_escape_string($tag);
$twhere .= "t.tag='{$tag}' or ";
}
$twhere .= "1=0";
$sql = "select fid,tid,m.tdate from " . getTable('metatag') . " m " . "inner join " . getTable('tag') . " t on t.id = m.tid where m.ttype = 'item'" . " and ({$twhere})";
//echo $sql;
$res = rss_query($sql);
$fids = array();
$ctid = -1;
while (list($fid, $tid) = rss_fetch_row($res)) {
$fids[] = $fid;
$tids[] = $tid;
}
$fids = array_unique($fids);
$tids = array_unique($tids);
$rtags = array();
if (count($fids)) {
$sql = "select t.tag, count(*) as cnt from " . getTable('metatag') . " m left join " . getTable('item') . " i on (m.fid=i.id) " . " inner join " . getTable('tag') . " t on (t.id = m.tid) " . " where m.fid in (" . implode(",", $fids) . ")" . " and t.id not in (" . implode(",", $tids) . ")";
if (hidePrivate()) {
$sql .= " and not(i.unread & " . RSS_MODE_PRIVATE_STATE . ") ";
}
$sql .= " group by t.tag order by cnt desc";
//echo $sql;
$res = rss_query($sql);
while (list($rtag, $cnt) = rss_fetch_row($res)) {
$rtags[$rtag] = $cnt;
}
}
return $rtags;
}
开发者ID:abdallahchamas,项目名称:haiti_tracker,代码行数:35,代码来源:tags.php
示例2: checkETag
function checkETag($withDB = true, $keyPrefix = "", $cacheValidity = 0)
{
$key = $keyPrefix . '$Revision$' . $_SERVER["REQUEST_URI"];
if ($withDB) {
list($dt) = rss_fetch_row(rss_query('select timestamp from ' . getTable('cache') . " where cachekey='data_ts'"));
$key .= $dt;
}
if (array_key_exists(RSS_USER_COOKIE, $_REQUEST)) {
$key .= $_REQUEST[RSS_USER_COOKIE];
}
$key = md5($key);
if (array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER) && $_SERVER['HTTP_IF_NONE_MATCH'] == $key) {
header("HTTP/1.1 304 Not Modified");
header("X-RSS-CACHE-STATUS: HIT");
header("ETag: {$key}");
flush();
exit;
} else {
header("ETag: {$key}");
header("X-RSS-CACHE-STATUS: MISS");
if ($cacheValidity) {
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $cacheValidity * 3600) . 'GMT');
}
}
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:25,代码来源:core.php
示例3: provaGetByFiltro
function provaGetByFiltro($id_local = -1, $id_modalidade = -1, $status_array = null, $reject_status_array = null)
{
$where = '';
if ($id_local !== -1) {
$where .= $where == '' ? '' : ' AND ';
$where .= "id_local = " . dbInteger($id_local);
}
if ($id_modalidade !== -1) {
$where .= $where == '' ? '' : ' AND ';
$where .= "id_modalidade = " . dbInteger($id_modalidade);
}
if ($status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status IN ('" . join("', '", $status_array) . "')";
}
if ($reject_status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status NOT IN ('" . join("', '", $reject_status_array) . "')";
}
// if ($data !== null) {
// $where .= ($where == '') ? '' : ' AND ';
// $where .= "data_hora = " . dbDate($data);
// }
return getTable('provas_total', $where, 'data_hora, duracao');
}
开发者ID:ricain59,项目名称:fortaff,代码行数:25,代码来源:provas.php
示例4: print_parent_article_link
function print_parent_article_link($articleid)
{
$query = "SELECT title FROM articles WHERE articleid = " . $articleid . ";";
$table = getTable($query);
$row = getNextRow($table);
echo '<a href="index.php?articleid=' . $articleid . '&m_c=va">' . stripslashes($row['title']) . '</a>';
}
开发者ID:arewold,项目名称:calcuttagutta,代码行数:7,代码来源:util.php
示例5: elementoEquipaGetByFiltro
function elementoEquipaGetByFiltro($id_delegacao, $id_equipa, $id_elemento, $status_array, $reject_status_array)
{
$where = '';
if ($id_delegacao !== -1) {
$where .= $where == '' ? '' : ' AND ';
$where .= "id_delegacao = " . dbInteger($id_delegacao);
}
if ($id_equipa !== -1) {
$where .= $where == '' ? '' : ' AND ';
$where .= "id_equipa = " . dbInteger($id_equipa);
}
if ($id_elemento !== -1) {
$where .= $where == '' ? '' : ' AND ';
$where .= "id_elemento = " . dbInteger($id_elemento);
}
if ($status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status IN ('" . join("', '", $status_array) . "')";
}
if ($reject_status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status NOT IN ('" . join("', '", $reject_status_array) . "')";
}
if ($where == "") {
return array();
} else {
return getTable('elementos_equipas_total', $where, 'pais_nome, elemento_nome');
}
}
开发者ID:ricain59,项目名称:fortaff,代码行数:29,代码来源:elementosequipas.php
示例6: rss_search_channels_combo
function rss_search_channels_combo($id)
{
$ret = "\t\t<select name=\"{$id}\" id=\"{$id}\">\n" . "\t\t\t<option value=\"" . ALL_CHANNELS_ID . "\"" . (!array_key_exists(QUERY_CHANNEL, $_REQUEST) || $_REQUEST[QUERY_CHANNEL] == ALL_CHANNELS_ID ? " selected=\"selected\"" : "") . ">" . __('All') . "</option>\n";
$sql = "select " . " c.id, c.title, f.name, f.id " . " from " . getTable("channels") . " c " . " inner join " . getTable("folders") . " f " . " on f.id = c.parent ";
if (hidePrivate()) {
$sql .= " and not(c.mode & " . RSS_MODE_PRIVATE_STATE . ") ";
}
$sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE . ") ";
$sql .= " order by " . (getConfig('rss.config.absoluteordering') ? "f.position asc, c.position asc" : "f.name asc, c.title asc");
$res = rss_query($sql);
$prev_parent = -1;
while (list($id_, $title_, $parent_, $parent_id_) = rss_fetch_row($res)) {
if ($prev_parent != $parent_id_) {
if ($prev_parent > -1) {
$ret .= "\t\t\t</optgroup>\n";
}
if ($parent_ == "") {
$parent_ = __('Root');
}
$ret .= "\t\t\t<optgroup label=\"{$parent_} /\">\n";
$prev_parent = $parent_id_;
}
if (strlen($title_) > 25) {
$title_ = substr($title_, 0, 22) . "...";
}
$ret .= "\t\t\t\t<option value=\"{$id_}\"" . (array_key_exists(QUERY_CHANNEL, $_REQUEST) && $_REQUEST[QUERY_CHANNEL] == $id_ ? " selected=\"selected\"" : "") . ">{$title_}</option>\n";
}
if ($prev_parent != 0) {
$ret .= "\t\t\t</optgroup>\n";
}
$ret .= "\t\t</select>\n";
return $ret;
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:33,代码来源:searchform.php
示例7: sugestaoGetAll
function sugestaoGetAll($ids = null)
{
$where = '';
if ($ids !== null) {
$where = 'id_sugestao IN (' . join(', ', $ids) . ')';
}
return getTable('sugestoes_total', $where, 'data, id_sugestao');
}
开发者ID:ricain59,项目名称:fortaff,代码行数:8,代码来源:sugestoes.php
示例8: parametroGetAll
function parametroGetAll()
{
$pms = getTable("parametros", "", "");
$p = array();
while ($row = foreachRow($pms)) {
$p[$row['chave']] = $row['valor'];
}
return $p;
}
开发者ID:ricain59,项目名称:fortaff,代码行数:9,代码来源:jo_db.php
示例9: getArray
function getArray($query)
{
$table = getTable($query);
$array = array();
while ($row = getNextRow($table)) {
$array[] = $row;
}
return $array;
}
开发者ID:arewold,项目名称:calcuttagutta,代码行数:9,代码来源:mysql_dao.php
示例10: getConcretStsTableNames
private function getConcretStsTableNames()
{
$this->stablishmentTypeList = array();
$SQL = "SELECT * FROM stablishTypes " . "ORDER BY name ASC";
$rows = getTable($SQL);
foreach ($rows as $row) {
$this->stablishmentTypeList[$row['id']] = $row['tableName'];
}
}
开发者ID:rogelido,项目名称:traveltest,代码行数:9,代码来源:class.search.php
示例11: getAllUsersNames
function getAllUsersNames()
{
$query = "SELECT firstname FROM user ORDER BY firstname ASC";
$table = getTable($query);
while ($row = getNextRow($table)) {
$newtable[] = $row['firstname'];
// Add name to array
}
return $newtable;
}
开发者ID:arewold,项目名称:calcuttagutta,代码行数:10,代码来源:userService.php
示例12: getAllLanguageIds
function getAllLanguageIds()
{
$query = "SELECT id FROM Languages";
$table = getTable($query);
while ($row = getNextRow($table)) {
$newtable[] = $row['id'];
// Add id to array
}
return $newtable;
}
开发者ID:arewold,项目名称:calcuttagutta,代码行数:10,代码来源:languageService.php
示例13: userLeaderboard
function userLeaderboard($club, $discipline)
{
$disciplines = getDisciplines();
$users = getTable("SELECT u.id AS uid, u.fname AS fname, u.sname AS sname, u.sex AS sex, SUM(t.score) AS score, AVG(t.score) AS avg\r\n\t\t\t\t\t\t\tFROM users AS u, timeline AS t, rounds AS r\r\n\t\t\t\t\t\t\tWHERE u.clubid='" . $club['cid'] . "' AND u.id = t.userid AND r.id = t.roundid " . $disciplines[$discipline] . "\r\n\t\t\t\t\t\t\tGROUP BY u.id\r\n\t\t\t\t\t\t\tORDER BY score DESC");
$output = "<h2>Leaderboard:</h2>" . "<table class='leaderboard'>" . "<tr><td>Name</td><td>Total Score</td><td>Average Score</td></tr>";
for ($i = 0; $i < count($users); $i++) {
$output .= "<tr><td><a href='/group3/dashboard?uid=" . $users[$i]['uid'] . "'>" . $users[$i]['fname'] . " " . $users[$i]['sname'] . "</a></td><td>" . $users[$i]['score'] . "</td><td>" . round($users[$i]['avg'], 2) . "</td></tr>";
}
$output .= "</table>";
return $output;
}
开发者ID:jevkid,项目名称:OnTarget,代码行数:11,代码来源:index.php
示例14: merge
public function merge($entity)
{
$table = getTable($entity);
$data = getData($entity);
$idColumn = key($data);
$id = array_shift($data);
$where = buildWhere($idColumn, $id);
$update = $this->conn->update($table, $data);
$return = $update->where($where, $id)->execute();
return $return;
}
开发者ID:skvaros,项目名称:test,代码行数:11,代码来源:EntityManager.php
示例15: getLastBidInfo
function getLastBidInfo($auctionId)
{
$link = getConnection();
$tableName = getTable('auction_bid');
$sql = "SELECT * FROM `{$tableName}` WHERE `productauction_id`={$auctionId} AND `status`<>'2' ORDER BY `auctionbid_id` DESC";
$result = mysql_query($sql, $link);
if ($result) {
return mysql_fetch_assoc($result);
} else {
return false;
}
}
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:12,代码来源:auction.php
示例16: modalidadeGetByFiltro
function modalidadeGetByFiltro($status_array, $reject_status_array)
{
$where = '';
if ($status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status IN ('" . join("', '", $status_array) . "')";
}
if ($reject_status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status NOT IN ('" . join("', '", $reject_status_array) . "')";
}
return getTable('modalidades', $where, 'nome');
}
开发者ID:ricain59,项目名称:fortaff,代码行数:13,代码来源:modalidades.php
示例17: render
function render()
{
$res = rss_query("select url from " . getTable("channels") . " where id = " . $this->fid);
if (!defined('MAGPIE_DEBUG') || !MAGPIE_DEBUG) {
define('MAGPIE_DEBUG', true);
}
list($url) = rss_fetch_row($res);
define('MAGPIE_CACHE_ON', false);
$rss = fetch_rss($url);
echo "<pre>\n";
echo htmlentities(print_r($rss, 1));
echo "</pre>\n";
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:13,代码来源:debugfeed.php
示例18: eventosGetByFiltro
function eventosGetByFiltro($status_array, $reject_status_array)
{
$where = '';
if ($status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status IN ('" . join("', '", $status_array) . "')";
}
if ($reject_status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status NOT IN ('" . join("', '", $reject_status_array) . "')";
}
return getTable("eventos_total", $where, "id_evento");
}
开发者ID:ricain59,项目名称:fortaff,代码行数:13,代码来源:eventos.php
示例19: localGetByFiltro
function localGetByFiltro($status_array, $reject_status_array)
{
$where = '';
if ($status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status IN ('" . join("', '", $status_array) . "')";
}
if ($reject_status_array !== null) {
$where .= $where == '' ? '' : ' AND ';
$where .= "status NOT IN ('" . join("', '", $reject_status_array) . "')";
}
return getTable("locais", $where, "nome");
}
开发者ID:ricain59,项目名称:fortaff,代码行数:13,代码来源:locais.php
示例20: __exp__getFromDelicious
function __exp__getFromDelicious($id)
{
list($url) = rss_fetch_row(rss_query('select url from ' . getTable('item') . " where id={$id}"));
$ret = array();
$durl = "http://del.icio.us/url/" . md5($url) . "?settagview=list";
$bfr = getUrl($durl, 3000);
if ($bfr) {
define('DLSRX', '|<a href="/tag/([^"]+)".*>\\1</a>|U');
if ($bfr && preg_match_all(DLSRX, $bfr, $hits, PREG_SET_ORDER)) {
$hits = array_slice($hits, 0, MAX_TAGS_PER_ITEM);
foreach ($hits as $hit) {
$ret[] = $hit[1];
}
}
}
return "{$id}," . implode(" ", $ret);
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:17,代码来源:delicious.php
注:本文中的getTable函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论