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 Validate { | |
public $login; | |
public function __construct($login){ | |
$this->login = $login; | |
} | |
} |
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
public function get($table, $field, $operator, $value){ | |
$sql = "SELECT * FROM ". $table ." WHERE " . $field . $operator . $value; | |
$query = $this->_pdo->query($sql); | |
$r = $query->fetchAll(); | |
print_r($r); | |
} |
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 DB{ | |
private $_pdo; | |
private $count = 0; | |
public function __construct(){ | |
try{ | |
$this->_pdo = new PDO('mysql:host=localhost;dbname=wakamegroup', 'root' , ''); |
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 DB{ | |
private static $_instance = null; | |
private $_pdo, | |
$_query, | |
$_error=false, | |
$_results, | |
$_count=0; | |
public function __construct(){ |
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 db{ | |
public $con; | |
public function __construct(){ | |
$this->con = mysqli_connect("localhost", "root", "", "wakamegroup"); | |
if(!$this->con){ | |
echo 'failed '.mysqli_connect_error($this->con); |