background image

   $notes =$this->dao->fetchRows("select * from note order by timedate desc 
limit $startCount,$perNumber");
  return $notes;
  }

  function postNote ()
  {
  $name = $_POST['username'];
  $email = $_POST['email'];
  $content = $_POST['content'];
  $timedate = date ("y-m-d H:i",time());
    
   $sql   ="insert   into   note(name,email,content,timedate)   values('".$name."','".
$email."','".$content."','".$timedate."')";
  if ($this->dao->query ($sql))
  return true;
  else
  return false;
  }

  function deleteNote ()
  {
  $sql = "delete from note where id=".$_GET['id'];
  if($this->dao->query ($sql))
  return true;
  else
  return false;
  }
}
?>

问 题 二 : Model 属 于 MVC 中 的 M 层 吧 。 但 是 M 层 主 要 实 现 的 是 什 么 功 能 呢 ? 与
DataAccess 有什么很大的差别吗?

View.php
代码如下:
<?  
class View
{
  var $output;
  var $totalNumber;
  var $toatalPage;