diff --git a/src/BasicDB.php b/src/BasicDB.php index fb3da16..96852f0 100644 --- a/src/BasicDB.php +++ b/src/BasicDB.php @@ -139,10 +139,9 @@ public function __construct($host, $dbname, $username, $password, $charset = 'ut * $tableName * @return $this */ - public function select($tableName) + public function select($columns) { - $this->sql = 'SELECT * FROM `' . $tableName . '`'; - $this->tableName = $tableName; + $this->sql = 'SELECT ' . $columns; return $this; } @@ -153,9 +152,10 @@ public function select($tableName) * $from * @return $this */ - public function from($from) + public function from($tableName) { - $this->sql = str_replace('*', $from, $this->sql); + $this->sql .= ' FROM `' . $tableName . '`'; + $this->tableName = $tableName; return $this; }