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


PHP XDB::quote方法代码示例

本文整理汇总了PHP中XDB::quote方法的典型用法代码示例。如果您正苦于以下问题:PHP XDB::quote方法的具体用法?PHP XDB::quote怎么用?PHP XDB::quote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XDB的用法示例。


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

示例1: fetch_all_for_manage

 public function fetch_all_for_manage($tableid, $inforum = '', $authorid = 0, $filename = '', $keyword = '', $sizeless = 0, $sizemore = 0, $dlcountless = 0, $dlcountmore = 0, $daysold = 0, $count = 0, $start = 0, $limit = 0)
 {
     $sql = "1";
     if (!is_numeric($tableid) || $tableid < 0 || $tableid > 9) {
         return;
     }
     if ($inforum) {
         $sql .= is_numeric($inforum) ? " AND t.fid=" . XDB::quote($inforum) : '';
         $sql .= $inforum == 'isgroup' ? ' AND t.isgroup=\'1\'' : ' AND t.isgroup=\'0\'';
     }
     if ($authorid) {
         $sql .= " AND a.uid=" . XDB::quote($authorid);
     }
     if ($filename) {
         $sql .= " AND a.filename LIKE " . XDB::quote('%' . $filename . '%');
     }
     if ($keyword) {
         $sqlkeywords = $or = '';
         foreach (explode(',', str_replace(' ', '', $keyword)) as $keyword) {
             $sqlkeywords .= " {$or} a.description LIKE " . XDB::quote('%' . $keyword . '%');
             $or = 'OR';
         }
         $sql .= " AND ({$sqlkeywords})";
     }
     $sql .= $sizeless ? " AND a.filesize>'{$sizeless}'" : '';
     $sql .= $sizemore ? " AND a.filesize<'{$sizemore}' " : '';
     $sql .= $dlcountless ? " AND ai.downloads<'{$dlcountless}'" : '';
     $sql .= $dlcountmore ? " AND ai.downloads>'{$dlcountmore}'" : '';
     $sql .= $daysold ? " AND a.dateline<'" . (TIMESTAMP - intval($daysold) * 86400) . "'" : '';
     if ($count) {
         return XDB::result_first("SELECT COUNT(*)\n\t\t\t\tFROM " . XDB::table('forum_attachment_' . $tableid) . " a\n\t\t\t\tINNER JOIN " . XDB::table('forum_attachment') . " ai USING(aid)\n\t\t\t\tINNER JOIN " . XDB::table('forum_thread') . " t\n\t\t\t\tINNER JOIN " . XDB::table('forum_forum') . " f\n\t\t\t\tWHERE t.tid=a.tid AND f.fid=t.fid AND t.displayorder>='0' AND {$sql}");
     }
     return XDB::fetch_all("SELECT a.*, ai.downloads, t.fid, t.tid, t.subject, f.name AS fname\n\t\t\t\tFROM " . XDB::table('forum_attachment_' . $tableid) . " a\n\t\t\t\tINNER JOIN " . XDB::table('forum_attachment') . " ai USING(aid)\n\t\t\t\tINNER JOIN " . XDB::table('forum_thread') . " t\n\t\t\t\tINNER JOIN " . XDB::table('forum_forum') . " f\n\t\t\t\tWHERE t.tid=a.tid AND f.fid=t.fid AND t.displayorder>='0' AND {$sql} ORDER BY a.aid DESC " . XDB::limit($start, $limit));
 }
开发者ID:herosrx,项目名称:shops,代码行数:34,代码来源:table_forum_attachment.php


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