<?php
class Store {

    private $conn;
    private $table_name = "store";

    public $id;
    public $store; 

    public function __construct($db) {
        $this->conn = $db;
    }

    public function create() {
        $query = "INSERT INTO " . $this->table_name . " 
                  SET store = :store";
        $stmt = $this->conn->prepare($query);
        $stmt->bindParam(":store", $this->store);

        if ($stmt->execute()) {
            return true;
        }
        return false;
    }

    

    function getAllRows() {
        $query = "SELECT * FROM " . $this->table_name . " ORDER BY id";
        $stmt = $this->conn->prepare($query);
        $stmt->execute();
        return $stmt;
    }

}
?>
