class sql { function select ($what="*") { $this->part1 = "SELECT * "; } function from ($from) { $this->part2 = "FROM $from"; } function where ($where="",$value="") { if (!empty($where)) { $this->part3 = " WHERE $where = '$value'"; } else { $this->part3 = ""; } } function build ($show="0") { if ($show == 1) { echo $this->part1.$this->part2.$this->part3; } else { return mysql_query($this->part1.$this->part2.$this->part3); } } }