Skip to content

Instantly share code, notes, and snippets.

View Satwa's full-sized avatar
:bowtie:
me vs. me

Joshua Satwa

:bowtie:
me vs. me
View GitHub Profile
@Satwa
Satwa / Database.php
Created January 18, 2019 09:42
PHP Database lib
<?php
class Database{
function __construct(){
try{
$this->pdo = new PDO('sqlite:storage.db'); // can be MySQL too
$this->pdo->query("SET NAMES 'utf8'");
$this->pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}catch(PDOException $e){
/** Basic columns for prototyping **/
.col13{
float: left;
width: 32%;
padding-right:.49%;
min-width:200px;
max-width:300px;
}
.col23{