Last active
April 7, 2016 16:27
-
-
Save DylanYasen/727838b1ab9809aba96f246bab6d5d34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Model | |
{ | |
public $data; | |
function __construct() | |
{ | |
# | |
} | |
} | |
class Controller | |
{ | |
private $model; | |
function __construct($model) | |
{ | |
$this->model = $model; | |
$this->Connect(); | |
} | |
public function Submit(){ | |
} | |
public function Connect(){ | |
$servername = "localhost"; | |
$username = "root"; | |
$password = ""; | |
$dbname = "CMSC"; | |
// Create connection | |
$conn = new mysqli($servername, $username, $password, $dbname); | |
// Check connection | |
if ($conn->connect_error) { | |
die("Connection failed: " . $conn->connect_error); | |
} | |
$sql = "SELECT Column_name | |
FROM Information_schema.columns | |
WHERE Table_name like 'cri'"; | |
$result = $conn->query($sql); | |
echo($result); | |
$conn->close(); | |
} | |
} | |
class View | |
{ | |
private $model; | |
private $controller; | |
function __construct($controller,$model) | |
{ | |
$this->model = $model; | |
$this->controller = $controller; | |
} | |
public function output(){ | |
} | |
} | |
$model = new Model(); | |
$controller = new Controller($model); | |
$view = new View($controller, $model); | |
echo "<a>test</a>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment