phpfunk.com


Archive for April, 2011

log4php example

Wednesday, April 13th, 2011

This log4php example demonstrates how to the log4php library in a non-trivial way. log4php is a version of the Apache log4J package ported to PHP5. Please refer to the apache project for complete details. log4php is a powerful logging mechanism that allows you to use a configuration file to specify what types of messages you [...]

left join sql select with where clause or on conditional

Wednesday, April 6th, 2011

Given a database schema containing the following tables: CREATE TABLE `categories` ( `id` int(10) unsigned NOT NULL auto_increment, `category` varchar(31) NOT NULL default ”, PRIMARY KEY (`id`) ) ENGINE=InnoDB; CREATE TABLE `account_categories` ( `acct_id` int(10) unsigned NOT NULL, `cat_id` int(10) unsigned NOT NULL, `markup` decimal(3,2) NOT NULL default ’0.00′, PRIMARY KEY (`acct_id`,`cat_id`), KEY `cat_id` (`cat_id`), [...]

networked HP all-in-one printer on Debian

Tuesday, April 5th, 2011

These are my notes for using an HP C7280 All-In-One printer as a network printer for use with Debian squeeze. Install the package hpli-gui for a fancy UI front-end. We need to execute /usr/bin/hp-toolbox to set up the printer. First however you need to add your user to lpadmin, otherwise you will not be able [...]