本文整理汇总了PHP中cond_to_sqladd函数的典型用法代码示例。如果您正苦于以下问题:PHP cond_to_sqladd函数的具体用法?PHP cond_to_sqladd怎么用?PHP cond_to_sqladd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cond_to_sqladd函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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}");
}
示例2: forum__find
function forum__find($cond = array(), $orderby = array(), $page = 1, $pagesize = 1000)
{
$cond = cond_to_sqladd($cond);
$orderby = orderby_to_sqladd($orderby);
$offset = ($page - 1) * $pagesize;
$forumlist = db_find("SELECT * FROM `bbs_forum` {$cond}{$orderby} LIMIT {$offset},{$pagesize}", 'fid');
return $forumlist;
}
示例3: thread__find
function thread__find($cond = array(), $orderby = array(), $page = 1, $pagesize = 20)
{
$cond = cond_to_sqladd($cond);
$orderby = orderby_to_sqladd($orderby);
$offset = ($page - 1) * $pagesize;
$arrlist = db_find("SELECT tid FROM `bbs_thread` {$cond}{$orderby} LIMIT {$offset},{$pagesize}");
if (empty($arrlist)) {
return array();
}
$tids = implode(',', arrlist_values($arrlist, 'tid'));
return db_find("SELECT * FROM `bbs_thread` WHERE tid IN ({$tids})");
}
示例4: 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;
}
示例5: forum_access_count
function forum_access_count($cond = array())
{
$cond = cond_to_sqladd($cond);
$arr = db_find_one("SELECT COUNT(*) AS num FROM `bbs_forum_access` {$cond}");
return $arr['num'];
}
示例6: attach_count
function attach_count($cond = array())
{
$cond = cond_to_sqladd($cond);
$arr = db_find_one("SELECT COUNT(*) AS num FROM `bbs_attach` {$cond}");
return $arr['num'];
}
示例7: count
public function count($table, $cond = array())
{
$cond = cond_to_sqladd($cond);
$sql = "SELECT COUNT(*) AS num FROM `{$table}` {$cond}";
$arr = $this->find_one($sql);
return !empty($arr) ? intval($arr['num']) : $arr;
}