当前位置: 首页>>代码示例>>PHP>>正文


PHP db_find函数代码示例

本文整理汇总了PHP中db_find函数的典型用法代码示例。如果您正苦于以下问题:PHP db_find函数的具体用法?PHP db_find怎么用?PHP db_find使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了db_find函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: modlog__find

function modlog__find($cond = array(), $orderby = array(), $page = 1, $pagesize = 20)
{
    $cond = cond_to_sqladd($cond);
    $orderby = orderby_to_sqladd($orderby);
    $offset = ($page - 1) * $pagesize;
    return db_find("SELECT * FROM `bbs_modlog` {$cond}{$orderby} LIMIT {$offset},{$pagesize}");
}
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:7,代码来源:modlog.func.php

示例2: group__find

function group__find($cond = array(), $orderby = array(), $page = 1, $pagesize = 1000)
{
    $cond = cond_to_sqladd($cond);
    $orderby = orderby_to_sqladd($orderby);
    $offset = ($page - 1) * $pagesize;
    $grouplist = db_find("SELECT * FROM `bbs_group` {$cond}{$orderby} LIMIT {$offset},{$pagesize}", 'gid');
    return $grouplist;
}
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:8,代码来源:group.func.php

示例3: thread_top_find

function thread_top_find($fid = 0)
{
    if ($fid == 0) {
        $threadlist = db_find("SELECT * FROM `bbs_thread_top` WHERE top=3 ORDER BY tid DESC LIMIT 100", 'tid');
    } else {
        $threadlist = db_find("SELECT * FROM `bbs_thread_top` WHERE fid='{$fid}' AND top=1 ORDER BY tid DESC LIMIT 100", 'tid');
    }
    $tids = arrlist_values($threadlist, 'tid');
    $threadlist = thread_find_by_tids($tids, 1, 100);
    return $threadlist;
}
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:11,代码来源:thread_top.func.php

示例4: forum_delete

function forum_delete($fid)
{
    //  把板块下所有的帖子都查找出来,此处数据量大可能会超时,所以不要删除帖子特别多的板块
    $threadlist = db_find("SELECT tid, uid FROM `bbs_thread` WHERE fid='{$fid}'");
    foreach ($threadlist as $thread) {
        thread_delete($thread['tid']);
    }
    $r = forum__delete($fid);
    forum_list_cache_delete();
    return $r;
}
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:11,代码来源:forum.func.php

示例5: friendlink_find

function friendlink_find($cond = array(), $orderby = array(), $page = 1, $pagesize = 1000)
{
    $cond = cond_to_sqladd($cond);
    $orderby = orderby_to_sqladd($orderby);
    $offset = ($page - 1) * $pagesize;
    $friendlinklist = db_find("SELECT * FROM `bbs_friendlink` {$cond}{$orderby} LIMIT {$offset},{$pagesize}", 'linkid');
    if ($friendlinklist) {
        foreach ($friendlinklist as &$friendlink) {
            friendlink_format($friendlink);
        }
    }
    return $friendlinklist;
}
开发者ID:994724435,项目名称:Ride,代码行数:13,代码来源:friendlink.func.php

示例6: thread_new_find

function thread_new_find()
{
    $threadlist = db_find("SELECT * FROM `bbs_thread_new` ORDER BY tid DESC LIMIT 100");
    if (empty($threadlist)) {
        $threadlist = thread_find(array(), array('tid' => -1), 1, 100);
        foreach ($threadlist as $thread) {
            thread_new_create($thread['tid']);
        }
    } else {
        $tids = arrlist_values($threadlist, 'tid');
        $threadlist = thread_find_by_tids($tids, 1, 100, 'tid');
    }
    return $threadlist;
}
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:14,代码来源:thread_new.func.php

示例7: thread_lastpid_find

function thread_lastpid_find()
{
    $threadlist = db_find("SELECT * FROM `bbs_thread_lastpid` ORDER BY lastpid DESC LIMIT 100");
    if (empty($threadlist)) {
        // 此处特殊情况,一般不会执行到此处,无须索引
        $threadlist = thread_find(array(), array('lastpid' => -1), 1, 100);
        foreach ($threadlist as $thread) {
            thread_lastpid_create($thread['tid'], $thread['lastpid']);
        }
    } else {
        $tids = arrlist_values($threadlist, 'tid');
        $threadlist = thread_find_by_tids($tids, 1, 100, 'lastpid');
    }
    return $threadlist;
}
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:15,代码来源:thread_lastpid.func.php

示例8: forum_access_find_by_fid

function forum_access_find_by_fid($fid)
{
    $accesslist = db_find("SELECT * FROM `bbs_forum_access` WHERE fid='{$fid}' ORDER BY gid ASC LIMIT 100", 'gid');
    return $accesslist;
}
开发者ID:994724435,项目名称:Ride,代码行数:5,代码来源:forum_access.func.php

示例9: attach_gc

function attach_gc()
{
    global $time, $conf;
    $attachlist = db_find("SELECT * FROM bbs_attach WHERE pid='0'");
    if (empty($attachlist)) {
        return;
    }
    foreach ($attachlist as $attach) {
        // 如果是 1 天内的附件,则不处理,可能正在发帖
        if ($time - $attach['create_date'] < 86400) {
            continue;
        }
        $filepath = $conf['upload_path'] . $attach['filename'];
        is_file($filepath) and unlink($filepath);
    }
}
开发者ID:zhangjmy,项目名称:xibbs,代码行数:16,代码来源:attach.func.php

示例10: post_find_by_pids

function post_find_by_pids($pids)
{
    if (empty($pids)) {
        return array();
    }
    $sqladd = implode(',', $pids);
    return db_find("SELECT * FROM bbs_post WHERE pid IN({$sqladd})");
}
开发者ID:994724435,项目名称:Ride,代码行数:8,代码来源:post.func.php

示例11: ini_set

<?php

require_once "../../phplib/util.php";
ini_set('memory_limit', '512000000');
$lexems = db_find(new Lexem(), 'restriction like "%S%" or restriction like "%P%"');
$count = count($lexems);
foreach ($lexems as $lexem) {
    print "Regenerez {$lexem->form} {$lexem->modelType}{$lexem->modelNumber}{$lexem->restriction} ({$count} rămase)\n";
    $lexem->regenerateParadigm();
    $count--;
}
开发者ID:florinp,项目名称:dexonline,代码行数:11,代码来源:regenerateSingularLexems.php

示例12: getopt

<?php

require_once '../phplib/util.php';
require_once '../phplib/ads/adsModule.php';
require_once '../phplib/ads/diverta/divertaAdsModule.php';
$opts = getopt('s:');
if (count($opts) != 1) {
    print "Usage: fixDivertaBooks -s <start-id>\n";
    exit;
}
// Resolve some ambiguities automatically. List the form that is alphabetically first and specify what to return
$PREFERRED_FORMS = array('a' => 'a', 'al' => 'al', 'carte' => 'carte', 'cartea' => 'cartea', 'clasa' => 'clasa', 'fara' => 'fără', 'i' => 'i', 'ii' => 'ii', 'in' => 'în', 'la' => 'la', 'mai' => 'mai', 'mare' => 'mare', 'marea' => 'marea', 'povesti' => 'povești', 'print' => 'prinț', 'printul' => 'prințul', 's' => 's', 'sa' => 'să', 'si' => 'și', 'teste' => 'teste', 'ti' => 'ți', 'timp' => 'timp', 'top' => 'top');
$books = db_find(new DivertaBook(), "id >= {$opts['s']} order by id");
foreach ($books as $book) {
    print "Loaded: {$book->id} [{$book->title}]    [{$book->url}]\n";
    $origTitle = $book->title;
    // Preliminary stuff
    $book->title = trim($book->title);
    if (text_endsWith($book->title, ', ***')) {
        $book->title = substr($book->title, 0, -5);
    }
    switch ($book->sku) {
        case 'YDA00965':
            $book->title = 'Dicționar vizual spaniol-român';
            break;
        case 'YHG00310':
            $book->title = '77 de rețete celebre și poveștile lor';
            break;
        case 'YHU02030':
            $book->title = 'Zen aici și acum';
            break;
开发者ID:florinp,项目名称:dexonline,代码行数:31,代码来源:fixDivertaBooks.php

示例13: count

        if (count($lexems) != 1) {
            print "I {$longInfForm} are " . count($lexems) . " lexeme corespunzătoare\n";
        }
        foreach ($lexems as $longInf) {
            if (!$longInf->isLoc) {
                print "I {$longInf->formNoAccent} nu este în LOC {$LEXEM_EDIT_URL}{$longInf->id}\n";
                $longInf->isLoc = 1;
                $longInf->save();
            }
        }
    }
    if ($verb->modelType == 'VT') {
        $ifs = db_find(new InflectedForm(), "lexemId = {$verb->id} and inflectionId = {$INFL_PART}");
        $pm = ParticipleModel::loadByVerbModel($verb->modelNumber);
        assert($pm);
        foreach ($ifs as $if) {
            $partForm = $if->formNoAccent;
            $lexems = db_find(new Lexem(), "formNoAccent = '{$partForm}' and modelType = 'A' and modelNumber = '{$pm->adjectiveModel}'");
            if (count($lexems) != 1) {
                print "P {$partForm} are " . count($lexems) . " lexeme corespunzătoare\n";
            }
            foreach ($lexems as $part) {
                if (!$part->isLoc) {
                    print "P {$part->formNoAccent} nu este în LOC {$LEXEM_EDIT_URL}{$part->id}\n";
                    $part->isLoc = 1;
                    $part->save();
                }
            }
        }
    }
}
开发者ID:florinp,项目名称:dexonline,代码行数:31,代码来源:verifyLocVerbs.php

示例14: lookup

function lookup($sourceId, $cuv, $fd)
{
    if (!source_exists($sourceId)) {
        socket_write($fd, "550 invalid database, use SHOW DB for a list\r\n");
        return;
    }
    if ($sourceId == '*' || $sourceId == '!') {
        $sourceId = 0;
    }
    $cuv = StringUtil::cleanupQuery($cuv);
    $arr = StringUtil::analyzeQuery($cuv);
    $field = $arr[0] ? 'formNoAccent' : 'formUtf8General';
    $lexems = db_find(new Lexem(), "{$field} = '{$cuv}' order by formNoAccent");
    $definitions = Definition::loadForLexems($lexems, $sourceId, $cuv);
    $searchResults = SearchResult::mapDefinitionArray($definitions);
    if (!count($definitions)) {
        socket_write($fd, "552 no match\r\n");
        return;
    }
    socket_write($fd, "150 " . count($definitions) . " definition(s) found\r\n");
    foreach ($searchResults as $sr) {
        $def = pretty_print($sr->definition->internalRep);
        socket_write($fd, "151 \"" . $cuv . "\" " . $sr->source->id . " \"" . $sr->source->name . "\"\r\n");
        socket_write($fd, "{$cuv}\r\n{$def}");
        socket_write($fd, ".\r\n");
    }
    socket_write($fd, "250 ok\r\n");
}
开发者ID:florinp,项目名称:dexonline,代码行数:28,代码来源:dict-server.php

示例15: chdir

*/
chdir('../../../');
// 请修改配置文件,设置正确的 mysql 账号密码
$conf = (include './simple/4/conf.php');
include './xiunophp/xiunophp.php';
// 创建表
$r = db_exec("DROP TABLE IF EXISTS `test_user`");
$r = db_exec("CREATE TABLE `test_user` (\n  uid int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户编号',\n  username char(32) NOT NULL DEFAULT '' COMMENT '用户名',\n  password char(32) NOT NULL DEFAULT '' COMMENT '密码',\n  PRIMARY KEY (uid)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8");
// 插入数据
$r = db_exec("INSERT INTO `test_user` SET username='Jack'");
$r = db_exec("INSERT INTO `test_user` SET username='Tom'");
// 查找一条数据
$arr = db_find_one("SELECT * FROM `test_user` WHERE username='Jack'");
print_r($arr);
// 查找多条数据
$arrlist = db_find("SELECT * FROM `test_user` WHERE uid>0");
print_r($arrlist);
/*
结果输出:
Array
(
    [uid] => 1
    [username] => Jack
)
Array
(
    [0] => Array
        (
            [uid] => 1
            [username] => Jack
        )
开发者ID:xiuno,项目名称:xiunophp,代码行数:31,代码来源:4.php


注:本文中的db_find函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。