php oop and mysql
<p>I need to get data, to check and send to db.
Programming with PHP OOP.</p>

<p>Could you tell me if my class structure is good and how dislpay all data?. Thanks</p>

<pre><code>&lt;?php
class Database{

    private $DBhost = 'localhost';
    private $DBuser = 'root';
    private $DBpass = 'root';
    private $DBname = 'blog';

    public function connect(){
        //Connect to mysql db
    }

    public function select($rows){
        //select data from db
    }

    public function insert($rows){
        //Insert data to db
    }

    public function delete($rows){
        //Delete data from db
    }
}

class CheckData{

    public $number1;
    public $number2;

    public function __construct(){
        $this-&gt;number1 = $_POST['number1'];
        $this-&gt;number2 = $_POST['number2'];
    }

    function ISempty(){
        if(!empty($this-&gt;$number1)){
            echo "Not Empty";

            $data = new Database();
            $data-&gt;insert($this-&gt;$number1);
        }
        else{
            echo "Empty1";
        }

        if(!empty($this-&gt;$number2)){
            echo "Not Empty";

            $data = new Database();
            $data-&gt;insert($this-&gt;$number2);
        }
        else{
            echo "Empty2";
        }       
    }
}

class DisplayData{

    //How print all data?
    function DisplayNumber(){
        $data = new Database();
        $data-&gt;select();
    }   
}

$check = new CheckData();
$check-&gt;ISempty();

$display = new DisplayData()
$display-&gt;DisplayNumber();
?&gt;
</code></pre>
