PHP + MySQL: Checking to see if a record exists in the database

May 15, 2009

Quite often I need to look into the database to see if a record exists. For example, to check if a username already exists when creating a new user. I created a simple function to do this for me with mysqli. All I have to do is pass it the table name to look in,

PHP: Using a Registry

January 27, 2009

Over that last dozen or so projects I have worked on I have noticed that files containing settings, and other site specific data, tend to grow pretty quickly. Each time I open a settings file I struggle with the thought, ‘Do I use a define or a global variable?’. I do not really like using

PHP: Find and manipulate the data between delimiters

October 24, 2008

I am currently working on a site where the client has a rich text box to enter content for his articles. This is not unusual in itself, however he wants the ability to do some wikiish syntax in the text box and have the system magically produce the output for him. For instance, \[\[ThisIsSomePage\]\] could

PHP: Remove Query String Parameter by Name

October 22, 2008

There are many times when I have come across situations where I need to remove a parameter from the query string of a URI. Usually these are involved in sorting data from a database, and I want to put a sort_by or some such in the URI as a GET. When the page loads I

Building a Simple Template Parser in PHP

December 25, 2007

This article is for people looking to build a very simple template parsing system in PHP. Once you understand how a template system works feel free to take the ideas presented here and mold the system to your specifics. Note this article assumes a fair amount of ability with PHP and objects in PHP About