All pastes #169277 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-09-13 19:36 UTC
rendered paste body
    function &get($id)
    {
        $comment = false;
    	$id = intval($id);
        if ($id > 0) {
            $sql = 'SELECT * FROM '.$this->db->prefix('xoopscomments').' WHERE com_id='.$id;
            if (!$result = $this->db->query($sql)) {
                return $comment;
            }
            $numrows = $this->db->getRowsNum($result);
            if ($numrows == 1) {
                $comment = new XoopsComment();
                $comment->assignVars($this->db->fetchArray($result));
            }
        }
        return $comment;
    }