- $sql = "SELECT $this->nombre, $this->id
- FROM $this->tabla
- WHERE $this->padre = '$id'";
+ $sql = "SELECT $this->nombre, $this->id ";
+ if(!is_null($this->link))
+ $sql .= ", $this->link ";
+ $sql .= "FROM $this->tabla ";
+ if(!is_null($this->padre))
+ $sql .= "WHERE $this->padre = '$id'";