Skip to content

Instantly share code, notes, and snippets.

@DylanYasen
Last active April 7, 2016 16:27
Show Gist options
  • Save DylanYasen/727838b1ab9809aba96f246bab6d5d34 to your computer and use it in GitHub Desktop.
Save DylanYasen/727838b1ab9809aba96f246bab6d5d34 to your computer and use it in GitHub Desktop.
<?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