Updated the database class Usage: // min instantiation $dataBase = new DB(‘hostname’,’username’,’password’,’database’); // max instantiation $dataBase = new DB(‘hostname’,’username’,’password’,’database’,DEBUG_LEVEL,array(‘admin@domain.com’,’admin@domain2.com)); Class: class DB{ /* * DESCRIPTION: Object class, Handles all database…
Programming
compile your own lamp stack with mysqli
Install LAMP with one line One liner sudo apt-get install lamp-server^ Add CURL and enable mod-rewrite sudo apt-get install php5-curl sudo a2enmod rewrite To compile LAMP with mysqli and mysql…
simple mvc
Need a lightweight, fast, php mvc framework? I have written a small framework named “Simple MVC” it does exactly what it says on the box, its quick to install and…
sort a array by its value
To sort an array by its value, similiar to mysql sort by just use usort($array, create_function(‘$a, $b, $sortBy=”distance”‘, ‘return strnatcmp($a[$sortBy], $b[$sortBy]);’)); $array stores the array $sortBy set the key to…
styling form buttons with divs
Styling a button inside a form with multiple div`s to achieve a curved button with click events etc, can be done relatively easy with the use of javascript. firstly lets…
wordpress comment count as a button
Styling the wordpress comment count as a button/icon etc can be tricky because the normal call to the comments comments_popup_link(__(‘Comments (0)’), __(‘Comments (1)’), __(‘Comments (%)’)); formats the output as an…
ftp open in explorer by default in windows
How to make explorer open by default when opening an ftp connection, I found can be easy.. I needed to make IE6 style FTP access without the extra pop up…
WordPress blog to MU
Upgrading to wordpress MU manually from an old blog. At work I had to update an old wordpress installation from 2.3.2 all the way up to the latest version of…
Table pagination example PHP
Table Pagination in PHP can be easily achieved with this function. It is designed to be used in conjunction with the database class found here but can be used standalone…
Database class for php
Database class for php $dataBase = new DB(); (instaniates the database ready for CRUD) $result = $dataBase->getQuery(‘SELECT * FROM FOO WHERE bar=1’); ($result contains a multidimensional associative array) $id =…