Skip to content

Instantly share code, notes, and snippets.

View tvisser's full-sized avatar

T Visser tvisser

View GitHub Profile
@tvisser
tvisser / Database.class.php
Created March 2, 2017 09:55
PHP Class for flexible usage of any MySQL database. Just import the class anywhere and use its functions.
<?php
/**
* This class has several static functions for connecting and interacting with a MySQL database using the PDO extension.
*
* This class is focused on ease-of-use and flexibility. All functions are static and can be used anywhere without
* creating an instance. For it to work, just change the credentials in the top of the file to match yours, and you're good to go.
*
* The query function automatically detects if only one result is returned and array_shifts onto it (if $_force_array is set to FALSE).
* This makes querying a single row of data way easier. When you want to query more rows, be sure to set $_force_array to TRUE.
@tvisser
tvisser / Afas.class.php
Last active September 19, 2017 13:24
PHP Class for easily using the Afas GetConnector or UpdateConnector
<?php
/**
* Class Afas
*
* This class has 3 static functions for accessing data using the Afas GetConnectors and UpdateConnectors.
* It includes the GET, POST and PUT request in their valid format.
*
* IMPORTANT: For it to work, remember to change the BASE_URL and TOKEN constants in the class.
*