c_util.php

来自「转载中国源码下载站 1) 基于PHP语言开发,MYSQL数据库驱动的多用户留言」· PHP 代码 · 共 38 行

PHP
38
字号
<?php
/**
 * CuteBook 多用户留言本
 * 程式版權 (c) 2001 by midiguy www.jaxp.net
 * 作者Email: midiguy@263.net 欢迎批评指正
 * 请不要修改版权信息,谢谢
 */

class c_util extends c_base {
    function get_replies_count_by_topic($fatherid)
    {
        global $db_table;
        $SQL = "SELECT id from " . $db_table['reply'] . " where father_id=" . $fatherid;
        $result = $this->c_db->query($SQL);
        $total = $this->c_db->num_rows($result);
        return $total;
    } 

    function get_topics_count_by_user($userid)
    {
        global $db_table;
        $SQL = "SELECT id from " . $db_table['topic'] . " where userid=" . $userid;
        $result = $this->c_db->query($SQL);
        $total = $this->c_db->num_rows($result);
        return $total;
    } 

    function get_replies_count_by_user($userid)
    {
        global $db_table;
        $SQL = "SELECT t1.id from " . $db_table['reply'] . " as t1," . $db_table['topic'] . " as t2 where t1.father_id=t2.id and t2.userid=" . $userid;
        $result = $this->c_db->query($SQL);
        $total = $this->c_db->num_rows($result);
        return $total;
    } 
} 

?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?