Skip to content

Instantly share code, notes, and snippets.

@exileed
Forked from Oappot/Connect.php (unwork)
Last active November 22, 2017 00:33
Show Gist options
  • Save exileed/13df47a330fdaa544839b64f7aab3e6d to your computer and use it in GitHub Desktop.
Save exileed/13df47a330fdaa544839b64f7aab3e6d to your computer and use it in GitHub Desktop.
<?php
include ('Connect.php');
$test = new Connect;
$test->createUser();
?>
<?php
class Connect {
private $connection;
public function __construct(){
$this->connect();
}
public function connect(){
$this->connection = new PDO('mysql:host=orfarile;dbname=orfarile', 'root', '');
}
function selectTests(){
}
public function createUser(){
$this->connection->query("INSERT INTO users(user_login, user_password) VALUES ('test1', 'test1')");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment