News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Make Me Pulse Blog:
PHP 5 Design Pattern Singleton
November 22, 2007 @ 08:46:00

On the Make Me Pulse blog today, Antoine Ughetto takes a look at one of the more handy things in programming - design patterns. He specifically looks at the Singleton pattern this time - complete with explanations and code examples.

The singleton can be use in lot of different cases. In this example we will make a MySQL connection Singleton class. This will help us to always use the same connection.

The code not only shows how to make the class using the Singleton but how to use it in your app - calling it with a SQL statement to make your request.

1 comment voice your opinion now!
desgnpattern singleton example mysql desgnpattern singleton example mysql


blog comments powered by Disqus

Similar Posts

Community News: Zagreb PHP User Group December 2011 Meeting - 13th @ 6pm

Pierre-Alain Joye's Blog: how to do not work around filter (don't be lazy :)

Codewalkers.com: Book Raffle - Beginning PHP and MySQL 5 - From Novice to Professional

Padraic Brady's Blog: Example Zend Framework Blog Application Tutorial - Part 9 PDF Download

DevShed: Creating a MySQL Abstraction Layer with Bridge Classes in PHP 5


Community Events





Don't see your event here?
Let us know!


list framework series community voicesoftheelephpant podcast opinion symfony package introduction bugfix deployment language tips interview api install library release laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework