Вход Регистрация
Файл: include/quest_msg.php
Строк: 34
<?php

include_once("table_name.php");
include_once(
"base.php");

/**
    quest message
*/

class CQuestMsg extends CBase 
{
    var 
$room_id;
    
/**
        Constructor
    */
    
function CQuestMsg($database,$room_id)
    {
        global 
$table_quest_msg;
    
        
$this->db $database;
        
$this->table_name=$table_quest_msg;
        
$this->room_id=$room_id;    
    }
    
    function 
getAllDialogs()
    {
        
$sql "select vnum,question from $this->table_name where room_id=$this->room_id";
        
        
$result $this->execSQL($sql);
        
        
$dialog_msg = array();
        
        
//cycle on all things
        
while($row $result->fetchRow())
        {
            
$dialog_msg[]=array("vnum" => $row[0], "question" => $row[1]);
        }
        
        return 
$dialog_msg;
    }
    
    function 
getDialog($vnum)
    {
        
$sql "select question,answer from $this->table_name where vnum=$vnum";
        
        
$result $this->execSQL($sql);
        
        if(
$result->numRows()==0) return false;
        
        
$row $result->fetchRow();
        
        
$dialog = array("question" => $row[0], "answer" => $row[1]);
        
        return 
$dialog;
    }

}

?>
Онлайн: 2
Реклама