Skip to content

Instantly share code, notes, and snippets.

View karellism's full-sized avatar
:electron:
Educating myself

Karel Vanhelden karellism

:electron:
Educating myself
  • Karellism
  • karelvanhelden@gmail.com
View GitHub Profile
@karellism
karellism / connectDB.php
Created November 1, 2015 02:38
Connect to database for simple CMS - php file
public function connect() {
mysql_connect($this->host,$this->username,$this->password) or die("Could not connect. " . mysql_error());
mysql_select_db($this->table) or die("Could not select database. " . mysql_error());
return $this->buildDB();
}
@karellism
karellism / buildDB.php
Created November 1, 2015 02:37
Create a database for the simple CMS - php file
private function buildDB() {
$sql = <<<MySQL_QUERY
CREATE TABLE IF NOT EXISTS testDB (
title VARCHAR(150),
bodytext TEXT,
created VARCHAR(100)
)
MySQL_QUERY;
return mysql_query($sql);
@karellism
karellism / SimpleCMS.php
Created November 1, 2015 02:34
Code template for a simple CMS - php class
<?php
class simpleCMS {
var $host;
var $username;
var $password;
var $table;
public function display_public() {
@karellism
karellism / codeforcestemplate.cpp
Last active February 15, 2019 08:12
CodeForces C++ Template
/*
* Karellism - Karel Vanhelden
* Problem ??
*/
using namespace std;
#include <bits/stdc++.h>
#define rep(i,n) for(auto i=0; i<(n); i++)