有没有高手帮忙指教一下啊,都不知道怎么学了,或者推荐几本书看看也行

解决方案 »

  1.   

    你到php100上下载视频看,效果会好点。顺便你按教程动手写一段代码。
      

  2.   

    php5和java、c#的面向对像使用是一样的吧,属性、方法,其实如果理解了OOP 方法,在哪个语言下都一样。
      

  3.   

    怎么也得熬过去,我也是熬过来的人,只要过了那个槛就不难了,反而看面相过程的程序更费劲的。
    如果公司有项目做,那就用框架写一个看看,推荐使用thinkPHP。
    如果没项目做,强制性的自己写一个项目,不管是什么,但是一定要用框架,因为框架是结合了OOP思路和MVC模式了的,对你的学习很有帮助的!
      

  4.   

    我觉得可以学习一下C++的OOP,如果C++学会了,那么PHP的肯定没问题。
      

  5.   

    应该了解OO思想
    用你追女孩子那股不要脸的劲头,很快就入门了,而且,到手后,不会跟女朋友一样是不是耍脾气
    不过,你编写php不一定非得面向对象
      

  6.   

    学习oo不要从php开始,简易学ror
      

  7.   

    面对对象没你说的那么夸张,就是设定一个对象是猪
    属性:重量,颜色
     转为变量$wight
    行动:走路
      function onload(){
         //行走的操作
      }
    最后就是把这个丢到一个 class pig() 这个类里面
    然后 $p = new pig();
    最后$p->onload() 调用方法
    其实就是针对你以前随便调用函数而言,这里是将函数封装到类里面,通过类去调用而已。
      

  8.   

    先学习java   再学php  这样蛮容易的  呵呵 
      

  9.   


    <?php
    include_once("incClass.php");class DAO{
    protected $conn;
    protected $table;
    public $errors;
    function __construct($table){
    $this->conn = getConn();
    $this->table = $table;
    $this->errors = false;
    }
    function get($Id){
    $rs = $this->conn->execute("select * from $this->table where id =$Id");
    return  $rs->GetArray();
    }
    function save($fields,$Id = false){
    if (!$Id) {
    //insert
    $rs=$this->conn->Execute("SELECT * FROM $this->table");
    $insertSQL = $this->conn->GetInsertSQL($rs, $fields);
    $this->conn->Execute($insertSQL); 
    if ($this->conn->ErrorMsg()) $this->errors = $this->conn->ErrorMsg();
    }
    else {
    //update
    $rs=$this->conn->Execute("SELECT * FROM $this->table where id=$Id");
    $updateSQL = $this->conn->GetUpdateSQL($rs, $fields);
    $this->conn->Execute($updateSQL);
    //if ($this->conn->ErrorMsg()) $this->errors= $this->conn->ErrorMsg();
    }
    }
    function delete($Id){
    $sql="delete from $this->table where id=$Id";
    $this->conn->execute($sql);
    if ($this->conn->ErrorMsg()) $this->errors= $this->conn->ErrorMsg();
    }
    }class IdbDao extends DAO {
    function __construct(){
    parent::__construct("idb");
    }
    function delete($id){
    $sql = "delete from amendsdetaildb where Iid=$id";
    $this->conn->execute($sql);
    parent::delete($id);
    }

    }class AdmendsDetailDbDAO extends DAO {
    function __construct(){
    parent::__construct("amendsdetaildb");
    }
    function getDetail($Iid){
    $rs = $this->conn->execute("select * from $this->table where Iid =$Iid");
    return  $rs->GetArray();
    }
    }class ObjectDbDAO extends DAO {
    function __construct(){
    parent::__construct("objectdb");
    }
    }?>
      

  10.   

    上面关于数据库crud的DAO类。每一张表继承DAO就可以实现数据库的crud。
      

  11.   

    和Java C#差不多的 自己看看 兄弟连的视频也不错~ 实际项目开发一般只要看懂别人的 目前自己写还是面向过程~