mirror of
https://github.com/Relintai/mourne_rcpp_fw.git
synced 2024-12-27 23:17:11 +01:00
33 lines
465 B
PHP
33 lines
465 B
PHP
|
<?php
|
||
|
|
||
|
class News_model extends MO_Model
|
||
|
{
|
||
|
|
||
|
function get_news($page)
|
||
|
{
|
||
|
$p = ($page - 1) * 5;
|
||
|
|
||
|
$sql = "SELECT * FROM news LIMIT $p, 5";
|
||
|
|
||
|
$q = $this->db->query($sql);
|
||
|
|
||
|
return $q->result_array();
|
||
|
}
|
||
|
|
||
|
function add_news($text, $uname)
|
||
|
{
|
||
|
$sql = "INSERT INTO news VALUES(default, '$uname', '$text')";
|
||
|
|
||
|
return $this->db->query($sql);
|
||
|
}
|
||
|
|
||
|
function del_news($id)
|
||
|
{
|
||
|
$sql = "";
|
||
|
return $this->db->query($sql);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
//nowhitesp
|