I have a database class which contains the following method:
Fine.Code:class Database { // Fetch array - one column public function fetch_array_column_ex(){ $query = $this->execute(); return $query->fetchAll(PDO::FETCH_COLUMN, 0); } // End fetch_array() function }
I then extended the Database class like so:
Instead of retuning $STH I want to call the Database method fetch_array_column_ex() but I'm getting confused about how...Code:class Node extends Database { public function fetch_array_column_user($user_id) { $STH = $this->connection->prepare("SELECT username FROM user WHERE id = :user_id" ); $STH->bindParam(':user_id', $user_id, PDO::PARAM_INT); return $STH; } }// End function fetch_array_column_user()



Reply With Quote




Bookmarks