Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once 'database.php';
- class FORUM {
- private $rows;
- function __construct($DB_con)
- {
- $this->db = $DB_con;
- $this->rows = $rows;
- }
- public function getColumn() {
- try {
- $query = $this->db->prepare("DESCRIBE threads");
- $query->execute();
- //retrieve the columns inside the table posts
- $this->rows = $query->fetchAll(PDO::FETCH_COLUMN);
- } catch(PDOException $e) {
- echo $e->getMessage();
- }
- }
- public function setColumn() {
- //output the column values
- foreach($this->rows as $row) {
- echo $row . "</br>";
- }
- }
- } //End forum class
- $forum = new FORUM($DB_con);
- $forum->setColumn();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement